Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Debugging Gitlab issue fix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Phileas
Debugging Gitlab issue fix
Commits
c06dd192
Verified
Commit
c06dd192
authored
1 year ago
by
fpletz
Browse files
Options
Downloads
Patches
Plain Diff
ci: build docker image with cache
parent
5bdd1b08
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#10920
failed
1 year ago
Stage: prep
Stage: check
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+39
-4
39 additions, 4 deletions
.gitlab-ci.yml
flake.nix
+15
-3
15 additions, 3 deletions
flake.nix
with
54 additions
and
7 deletions
.gitlab-ci.yml
+
39
−
4
View file @
c06dd192
stages
:
-
prep
-
check
-
build
-
deploy
variables
:
GIT_SUBMODULE_STRATEGY
:
recursive
CACHIX_CACHE_NAME
:
flow3r
BUILD_IMAGE_NAME
:
${CI_REGISTRY_IMAGE}/flow3r-build:${CI_COMMIT_SHA}
default
:
# built via:
# docker load < $(nix-build nix/docker-image.nix)
image
:
registry.k0.hswaw.net/q3k/flow3r-build:ymrsh8w1z9l89qvvksw52k7sl54lx73q
image
:
$BUILD_IMAGE_NAME
.nix-build
:
image
:
docker.nix-community.org/nixpkgs/nix-flakes
before_script
:
-
nix profile install .#cachix
cache-devenv
:
extends
:
.nix-build
stage
:
prep
script
:
-
set +e +o pipefail
-
nix profile install .#jq
-
|
nix flake archive --json \
| jq -r '.path,(.inputs|to_entries[].value.path)' \
| cachix push "$CACHIX_CACHE_NAME"
-
nix develop -L --profile dev-profile -c
true
-
cachix push "$CACHIX_CACHE_NAME" dev-profile
docker-image
:
extends
:
.nix-build
stage
:
prep
needs
:
[
"
cache-devenv"
]
script
:
-
set +e +o pipefail
-
nix profile install .#skopeo .#jq
-
|
nix build -L --json .#dockerImage \
| jq -r '.[].outputs | to_entries[].value' \
| cachix push "$CACHIX_CACHE_NAME"
-
|
echo "${CI_REGISTRY_PASSWORD}" \
| skopeo login --username="${CI_REGISTRY_USER}" --password-stdin "${CI_REGISTRY}"
-
skopeo copy --tmpdir /tmp --insecure-policy "docker-archive://${PWD}/result" "docker://${BUILD_IMAGE_NAME}"
clang-tidy
:
stage
:
check
...
...
@@ -57,7 +92,7 @@ simulate:
script
:
-
python3 sim/run.py screenshot
artifacts
:
expose_as
:
'
Smulator
Screenshot'
expose_as
:
'
S
i
mulator
Screenshot'
paths
:
[
'
flow3r.png'
]
expire_in
:
5 hours
...
...
This diff is collapsed.
Click to expand it.
flake.nix
+
15
−
3
View file @
c06dd192
{
description
=
"flow3r badge flake"
;
nixConfig
=
{
substituters
=
[
"https://cache.nixos.org"
"https://flow3r.cachix.org"
];
trusted-public-keys
=
[
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"flow3r.cachix.org-1:/v8059Hm6UdEVNKE15uxltpYM0z+pulaTpobjIvFM5A="
];
};
inputs
=
{
nixpkgs
.
url
=
"github:NixOS/nixpkgs/nixpkgs-unstable"
;
flake-compat
=
{
...
...
@@ -66,6 +77,8 @@
{
overlays
.
default
=
import
./nix/overlay
;
legacyPackages
=
forAllPkgs
(
pkgs
:
pkgs
);
packages
=
forAllPkgs
(
pkgs
:
{
dockerImage
=
pkgs
.
dockerTools
.
buildImage
{
...
...
@@ -81,9 +94,8 @@
pathsToLink
=
[
"/bin"
];
};
runAsRoot
=
''
#!
${
pkgs
.
runtimeShell
}
mkdir -p /tmp
extraCommands
=
''
mkdir -p -m 1777 tmp
''
;
config
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment