Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stages:
- - deploy
- deploy_staging:
- stage: deploy
- before_script:
- - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- - eval $(ssh-agent -s)
- - mkdir -p ~/.ssh
- - chmod 700 ~/.ssh
- - echo "$SSH_PRIVATE_KEY" | ssh-add - > ~/.ssh/id_rsa
- - chmod 400 ~/.ssh/id_rsa
- - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- script:
- - ssh -p22 xxx@xxxx "chmod 400 ~/.ssh/id_rsa && cd xxxxxx && git pull develop"
- environment:
- name: staging
- deploy_prod:
- stage: deploy
- script:
- - echo "Deploy to production server"
- environment:
- name: production
- when: manual
- only:
- - master
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement