From b25710390148b592062ea770d7b63f3fc6a46a96 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 6 Mar 2022 10:32:29 +0000 Subject: [PATCH 1/3] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 88d5caa..7568698 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,8 @@ stages: # List of stages for jobs, and their order of execution - test - deploy +image: debian + docker-build: # Use the official docker image. image: docker:latest @@ -29,5 +31,23 @@ docker-build: - if: $CI_COMMIT_BRANCH exists: - Dockerfile - - if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev" + - if: ($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev") when: always + +before_script: + - apt-get update -qq + - apt-get install -qq git + # Setup SSH deploy keys + - 'which ssh-agent || ( apt-get install -qq openssh-client )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + +deploy_staging: + type: deploy + script: + - ssh $SSH_SERVER "cd /root && docker-compose up -d shbot && exit" + only: + - master + \ No newline at end of file From 4849bafce3150ffcb25900dfc8bdc3eb2852044f Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 6 Mar 2022 10:36:37 +0000 Subject: [PATCH 2/3] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7568698..6158063 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,8 +31,9 @@ docker-build: - if: $CI_COMMIT_BRANCH exists: - Dockerfile - - if: ($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev") - when: always + only: + - master + - dev before_script: - apt-get update -qq @@ -47,7 +48,7 @@ before_script: deploy_staging: type: deploy script: - - ssh $SSH_SERVER "cd /root && docker-compose up -d shbot && exit" + - ssh $SSH_SERVER "cd /root && docker-compose up -d bot && exit" only: - master \ No newline at end of file From bdcd2ba7410191a736e5bccc44344347048cdde6 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sun, 6 Mar 2022 10:37:27 +0000 Subject: [PATCH 3/3] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6158063..14156eb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,11 +26,6 @@ docker-build: fi - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . - docker push "$CI_REGISTRY_IMAGE${tag}" - # Run this job in a branch where a Dockerfile exists - rules: - - if: $CI_COMMIT_BRANCH - exists: - - Dockerfile only: - master - dev