ci: test the deploy

This commit is contained in:
silver 2023-07-26 23:23:55 +01:00
parent 3465f645b9
commit ed6b61e13f

View file

@ -3,7 +3,7 @@
stages:
- flake
- test
#- deploy
- deploy
# Passed in from upstream
# $PACKAGE_NAME = name of the flake that needs to be updated
@ -49,24 +49,25 @@ build:
# use ctrl+/ on intellij to mass uncoment
# set up deployment later
#deploy:
# stage: deploy
# # from https://forum.gitlab.com/t/git-push-from-inside-a-gitlab-runner/30554/5
# before_script:
# # Check for ssh-agent + rsync and install if not present
# #- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# - eval $(ssh-agent -s)
# # Inject the remote's private key
# - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
# - mkdir -p ~/.ssh
# - chmod 700 ~/.ssh
# # Append keyscan output into known hosts
deploy:
stage: deploy
# from https://forum.gitlab.com/t/git-push-from-inside-a-gitlab-runner/30554/5
before_script:
# Check for ssh-agent + rsync and install if not present
#- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
# Inject the remote's private key
- echo "$DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
# Append keyscan output into known hosts
# - ssh-keyscan $SERVER_IP >> ~/.ssh/known_hosts
# - chmod 644 ~/.ssh/known_hosts
#
# script:
# # this will grab a fresh copy of teh repo
# - ssh $SERVER_USER@$SERVER_IP "cd /etc/nixos && git stash && git pull origin main && nixos-rebuild switch"
- . "$HOME/.nix-profile/etc/profile.d/nix.sh"
script:
# this will grab a fresh copy of teh repo
- nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- apply --on @active-dns
#
# only:
# refs: