From 7bda3392e961c505a26c7beec4e946d10636855e Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Tue, 10 Nov 2020 20:42:15 +0100 Subject: [PATCH] Added deploy phase to gitlab ci Signed-off-by: Louis Vallat --- .gitlab-ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5719b8d..fde3960 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 @@ -74,4 +75,13 @@ release-master: - docker build . -t $CONTAINER_RELEASE_IMAGE - docker push $CONTAINER_RELEASE_IMAGE only: - - master \ No newline at end of file + - master + +deploy: + stage: deploy + before_script: + - 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;"