From bba0156cf86dc0a3f9c5df98a9f04cad1cd80433 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Thu, 27 Jul 2023 20:34:39 +0000 Subject: [PATCH] ci: test2 --- .gitlab-ci.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1b15772..b9d8146 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,9 +5,6 @@ stages: - test - deploy -variables: - FLAKE_COMMIT: "main" - # Update the flake for any changes upstream # Passed in from upstream # $PACKAGE_NAME = name of the flake that needs to be updated @@ -35,7 +32,11 @@ update: - git remote rm origin && git remote add origin ssh://git@gitlab.skynet.ie:2222/compsoc/skynet/nixos.git - git push origin HEAD:$CI_COMMIT_REF_NAME # update teh hash for further along in the pipeline - - $FLAKE_COMMIT=$(git rev-parse HEAD) + # https://nsirap.com/posts/043-change-value-of-variable-in-gitlab%20copy/ + - echo "FLAKE_COMMIT=$(git rev-parse HEAD)" >> flake.env + artifacts: + reports: + dotenv: flake.env only: refs: - main @@ -47,7 +48,7 @@ build: before_script: - . "$HOME/.nix-profile/etc/profile.d/nix.sh" # use the new flake - - git pull origin $FLAKE_COMMIT + - (if [ "$FLAKE_COMMIT" != "" ]; git pull origin $FLAKE_COMMIT; fi); script: - nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- build @@ -62,7 +63,7 @@ deploy: - chmod 700 ~/.ssh # load nix environment - . "$HOME/.nix-profile/etc/profile.d/nix.sh" - - git pull origin $FLAKE_COMMIT + - (if [ "$FLAKE_COMMIT" != "" ]; git pull origin $FLAKE_COMMIT; fi); script: # dns is always deployed first - nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- apply --on @active-dns