From e513877019d967a5fa5f924df3d50762be338dab Mon Sep 17 00:00:00 2001 From: lukas Date: Sun, 7 Nov 2021 18:05:46 +0100 Subject: [PATCH] test deploy to sec server --- .gitlab-ci.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6442c6c..8b8f1c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -115,8 +115,11 @@ Test_Server: - Frontend_Tests - Backend_Tests - Debian_Server - only: - - master + rules: + - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH # run this always on default branch + - if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH # allow triggering this manually + when: manual + allow_failure: true script: - eval $(ssh-agent -s) - echo "$SSH_PRIVATE_KEY" | ssh-add - @@ -126,3 +129,24 @@ Test_Server: - ssh root@192.168.0.42 "DEBIAN_FRONTEND=noninteractive apt-get --reinstall -y -qq install /tmp/OpenMediaCenter-*.deb && rm /tmp/OpenMediaCenter-*.deb" allow_failure: true +Test_Server_2: + stage: deploy + image: luki42/ssh:latest + needs: + - Frontend_Tests + - Backend_Tests + - Debian_Server + rules: + - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH # run this always on default branch + - if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH # allow triggering this manually + when: manual + allow_failure: true + script: + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY_2" | ssh-add - + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - scp deb/OpenMediaCenter-*.deb root@192.168.0.209:/tmp/ + - ssh root@192.168.0.209 "DEBIAN_FRONTEND=noninteractive apt-get --reinstall -y -qq install /tmp/OpenMediaCenter-*.deb && rm /tmp/OpenMediaCenter-*.deb" + allow_failure: true +