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 git -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