From 42dd0e8dca1643a73de0bbe88ab5cb41efdcf076 Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Fri, 16 Apr 2021 16:28:51 +0200 Subject: [PATCH] Added the deploy phase of the CI/CD 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 15ea919..abf0644 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ stages: - test - package - release + - deploy # Disable the Gradle daemon for Continuous Integration servers as correctness # is usually a priority over speed in CI environments. Using a fresh @@ -75,3 +76,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;"