-
-
Save unkray/43a143ba51c370489f8ced4d9c6280f9 to your computer and use it in GitHub Desktop.
GitLab Continuous Integration with Capistrano 3
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
| # Take valid private key for $SSH_PRIVATE_KEY variable to the agent store | |
| # cat .ssh/id_rsa | base64 -w0 >> ./deploy_key | |
| image: ruby:2.6 | |
| stages: | |
| - deploy | |
| deploy_testing: | |
| environment: | |
| name: testing | |
| url: http://testing.host.com/ | |
| stage: deploy | |
| script: | |
| - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) | |
| - eval $(ssh-agent -s) | |
| - ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode) | |
| - gem install capistrano | |
| - cap testing deploy | |
| only: | |
| - testing | |
| tags: | |
| - deploy_testing | |
| deploy: | |
| environment: | |
| name: main | |
| url: http://main.host.com/ | |
| stage: deploy | |
| script: | |
| - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) | |
| - eval $(ssh-agent -s) | |
| - ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode) | |
| - gem install capistrano | |
| - cap main deploy | |
| only: | |
| - main | |
| tags: | |
| - deploy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment