- 
      
- 
        Save puncoz/328eb21c0235f1004db445d41dea9b75 to your computer and use it in GitHub Desktop. 
    Gitlab CI file for continous deployment using capistrano
  
        
  
    
      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
    
  
  
    
  | 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