diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 319bd66..8a5e066 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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