From c28af42650c01fe95e82b17aade28332093c92a9 Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Fri, 12 Mar 2021 08:10:09 +0100 Subject: [PATCH] Added deploy stage in gitlab-ci Signed-off-by: Louis Vallat --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d4fd6a..80fead8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,7 @@ services: stages: - release + - deploy # Disable the Gradle daemon for Continuous Integration servers as correctness # is usually a priority over speed in CI environments. Using a fresh @@ -31,3 +32,13 @@ release-master: - docker push $CONTAINER_RELEASE_IMAGE only: - 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;"