Created
June 28, 2017 08:23
-
-
Save timilsinabishal/0fe5cb178e97d741183265597361a1aa to your computer and use it in GitHub Desktop.
Gitlab CI file for continous deployment using capistrano
This file contains 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
image: ruby:latest | |
before_script: | |
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) | |
- eval $(ssh-agent -s) | |
- ssh-add <(echo -e "$SSH_PRIVATE_KEY") | |
- gem install capistrano | |
stages: | |
- deploy | |
staging: | |
stage: deploy | |
script: | |
- cap staging deploy user=${GITLAB_USER_EMAIL} branch=${CI_COMMIT_REF_NAME} | |
only: | |
- develop | |
production: | |
stage: deploy | |
script: | |
- cap production deploy user=${GITLAB_USER_EMAIL} branch=${CI_COMMIT_REF_NAME} | |
only: | |
- tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment