ci: improve teh pipeline

This commit is contained in:
silver 2024-07-20 13:38:35 +01:00
parent c5a651d98e
commit 2834fbba8d
Signed by: silver
GPG key ID: 54E2C71918E93B74

View file

@ -55,9 +55,16 @@ sync_repos:
- sync/repos.csv
.scripts_base: &scripts_base
# load nix environment
# load nix environment, enter dev shell, load cache and
- . "$HOME/.nix-profile/etc/profile.d/nix.sh"
- nix --extra-experimental-features 'nix-command flakes' profile install nixpkgs#colmena
# load teh dev shell so pipeline uses same binaries as devs
- nix --extra-experimental-features 'nix-command flakes' develop
# setup the cache
- attic login skynet https://nix-cache.skynet.ie/ $CACHE_KEY
- attic use skynet-cache
- attic watch-store skynet-cache &
# push all everything from the current system into cache (if its not already cached)
- attic push skynet-cache /run/current-system
.scripts_deploy: &scripts_deploy
# setup ssh key
@ -66,18 +73,12 @@ sync_repos:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
.scripts_cache: &scripts_cache
- nix --extra-experimental-features 'nix-command flakes' profile install nixpkgs#attic-client
- attic login skynet https://nix-cache.skynet.ie/ $CACHE_KEY
- attic use skynet-cache
# every commit on main will build and deploy
.build_template: &builder
tags:
- nix
before_script:
- *scripts_base
- *scripts_cache
rules:
- if: $UPDATE_FLAKE == "yes"
when: never
@ -94,7 +95,6 @@ sync_repos:
before_script:
- *scripts_deploy
- *scripts_base
- *scripts_cache
rules:
- if: $UPDATE_FLAKE == "yes"
when: never
@ -117,7 +117,6 @@ build:
<<: *builder
stage: test
script:
- attic watch-store skynet-cache &
- colmena build -v --on @active-dns
- colmena build -v --on @active-core
- colmena build -v --on @active