From 71c78d82b27174d76a93bd5b10328373a910c8f9 Mon Sep 17 00:00:00 2001 From: Ilya Date: Sat, 26 Mar 2022 21:03:50 +0000 Subject: [PATCH] Add new file --- .gitlab-ci.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..6e92c0e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,27 @@ +image: debian:stable + +stages: + - deploy + +deploy_prod: + stage: deploy + only: + - master + except: + - tags + before_script: + - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) + - apt-get update -y && apt-get install sshpass -y + - eval $(ssh-agent -s) + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - git checkout -b ci_processing + - git config --global user.name "Push Runner" + - git config --global user.email "runner@lab.knrg.su" + - echo "$SSH_PRIVATE_KEY" > ~/.ssh/key + - printf "host $PROD_HOST\n Port $PROD_PORT\n IdentityFile ~/.ssh/key" > ~/.ssh/config + #- chmod 600 "$SSH_PRIVATE_KEY" + - ssh-keyscan $PROD_HOST >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: + - git remote add dokku ssh://dokku@dokku2.redguy.ru/exchange-bot