Added deploy stage in gitlab-ci

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2021-03-12 08:10:09 +01:00
parent 1f95796279
commit c28af42650

View File

@ -4,6 +4,7 @@ services:
stages: stages:
- release - release
- deploy
# Disable the Gradle daemon for Continuous Integration servers as correctness # Disable the Gradle daemon for Continuous Integration servers as correctness
# is usually a priority over speed in CI environments. Using a fresh # is usually a priority over speed in CI environments. Using a fresh
@ -31,3 +32,13 @@ release-master:
- docker push $CONTAINER_RELEASE_IMAGE - docker push $CONTAINER_RELEASE_IMAGE
only: only:
- master - master
deploy:
stage: deploy
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
script:
- ssh -o StrictHostKeyChecking=no -p $SSH_PORT $SSH_DESTINATION "cd $PATH_TO_APPLICATION; $UPGRADE_COMMAND;"