mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
chore(repo): add soonix to generate .gitlab-ci.yml
This commit is contained in:
parent
e074d716c4
commit
6e4347af69
5 changed files with 137 additions and 2 deletions
54
.gitlab-ci.yml
Normal file
54
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# Generated by soonix, DO NOT EDIT
|
||||
build:image:
|
||||
after_script:
|
||||
- install -D result dist/nix-ci-$ARCH.tar.gz
|
||||
artifacts:
|
||||
paths:
|
||||
- dist
|
||||
image: nixpkgs/nix-flakes:latest
|
||||
parallel:
|
||||
matrix:
|
||||
- ARCH:
|
||||
- x86_64-linux
|
||||
- aarch64-linux
|
||||
script:
|
||||
- nix build .#image --system $ARCH
|
||||
stage: build-images
|
||||
deploy:image:
|
||||
before_script:
|
||||
- 'nix profile install nixpkgs#buildah
|
||||
|
||||
export PATH="$PATH:$HOME/.nix-profile/bin"
|
||||
|
||||
export REGISTRY_AUTH_FILE=${HOME}/auth.json
|
||||
|
||||
echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin
|
||||
$CI_REGISTRY
|
||||
|
||||
mkdir -p /etc/containers && echo ''{"default":[{"type":"insecureAcceptAnything"}]}''
|
||||
> /etc/containers/policy.json
|
||||
|
||||
mkdir -p /var/tmp
|
||||
|
||||
'
|
||||
image: nixpkgs/nix-flakes:latest
|
||||
needs:
|
||||
- build:image
|
||||
script:
|
||||
- "export NORMALIZED_BRANCH=${CI_COMMIT_BRANCH/\\//-}\nbuildah manifest create localhost/nix-ci\n\
|
||||
buildah manifest add localhost/nix-ci docker-archive:dist/nix-ci-x86_64-linux.tar.gz\n\
|
||||
buildah manifest add localhost/nix-ci docker-archive:dist/nix-ci-aarch64-linux.tar.gz\n\
|
||||
buildah manifest push --all localhost/nix-ci docker://${CI_REGISTRY_IMAGE}/nix-ci:${CI_COMMIT_SHORT_SHA}\n\
|
||||
# branches\nif [ -z \"$CI_COMMIT_TAG\" ]; then\n buildah manifest push --all\
|
||||
\ localhost/nix-ci docker://${CI_REGISTRY_IMAGE}/nix-ci:${NORMALIZED_BRANCH/main/latest}\n\
|
||||
fi\n# tags\nif [ -n \"$CI_COMMIT_TAG\" ]; then\n buildah manifest push --all\
|
||||
\ localhost/nix-ci docker://${CI_REGISTRY_IMAGE}/nix-ci:${CI_COMMIT_TAG}\nfi\n"
|
||||
stage: build-images
|
||||
include:
|
||||
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/nix-gitlab-ci@$CI_COMMIT_SHA@$CI_COMMIT_SHORT_SHA
|
||||
inputs:
|
||||
version: $CI_COMMIT_SHORT_SHA
|
||||
stages:
|
||||
- build-images
|
||||
- build
|
||||
- trigger
|
||||
Loading…
Add table
Add a link
Reference in a new issue