Created
May 23, 2017 11:20
-
-
Save agalisteo/552ca751e933c88c095ffff55b3c30ed to your computer and use it in GitHub Desktop.
Deploy from Gitlab CI to Dokku
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variables: | |
DOKKU_HOST: 'dokku.host.es' | |
IP_DOKKU_HOST: '1.2.3.4' | |
SSH_DOKKU_PORT: '22' | |
PROJECT_NAME: 'project_name' | |
stages: | |
- deploy_to_dokku | |
deploy_dokku: | |
stage: deploy_to_dokku | |
script: | |
- mkdir -p ~/.ssh | |
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa | |
- chmod 600 ~/.ssh/id_rsa | |
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config | |
- echo -e "Host $DOKKU_HOST\n Hostname $IP_DOKKU_HOST\n Port $SSH_DOKKU_PORT\n" >> ~/.ssh/config | |
- ssh-keyscan -H $DOKKU_HOST >> ~/.ssh/known_hosts | |
- git push dokku@$DOKKU_HOST:$PROJECT_NAME master | |
when: manual | |
only: | |
- master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment