ci: test2
This commit is contained in:
parent
ed3781473e
commit
bba0156cf8
1 changed files with 7 additions and 6 deletions
|
@ -5,9 +5,6 @@ stages:
|
||||||
- test
|
- test
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
variables:
|
|
||||||
FLAKE_COMMIT: "main"
|
|
||||||
|
|
||||||
# Update the flake for any changes upstream
|
# Update the flake for any changes upstream
|
||||||
# Passed in from upstream
|
# Passed in from upstream
|
||||||
# $PACKAGE_NAME = name of the flake that needs to be updated
|
# $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 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
|
- git push origin HEAD:$CI_COMMIT_REF_NAME
|
||||||
# update teh hash for further along in the pipeline
|
# 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:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- main
|
- main
|
||||||
|
@ -47,7 +48,7 @@ build:
|
||||||
before_script:
|
before_script:
|
||||||
- . "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
- . "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
||||||
# use the new flake
|
# use the new flake
|
||||||
- git pull origin $FLAKE_COMMIT
|
- (if [ "$FLAKE_COMMIT" != "" ]; git pull origin $FLAKE_COMMIT; fi);
|
||||||
script:
|
script:
|
||||||
- nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- build
|
- nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- build
|
||||||
|
|
||||||
|
@ -62,7 +63,7 @@ deploy:
|
||||||
- chmod 700 ~/.ssh
|
- chmod 700 ~/.ssh
|
||||||
# load nix environment
|
# load nix environment
|
||||||
- . "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
- . "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
||||||
- git pull origin $FLAKE_COMMIT
|
- (if [ "$FLAKE_COMMIT" != "" ]; git pull origin $FLAKE_COMMIT; fi);
|
||||||
script:
|
script:
|
||||||
# dns is always deployed first
|
# dns is always deployed first
|
||||||
- nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- apply --on @active-dns
|
- nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- apply --on @active-dns
|
||||||
|
|
Loading…
Reference in a new issue