Skip to content

Instantly share code, notes, and snippets.

@shaliko
Created August 21, 2017 15:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save shaliko/e03ec21d607eff8419052c08b8944b75 to your computer and use it in GitHub Desktop.
Save shaliko/e03ec21d607eff8419052c08b8944b75 to your computer and use it in GitHub Desktop.
GitLab Continuous Integration with Capistrano 4
image: ruby:2.4
stages:
- deploy
deploy_staging:
environment: staging
stage: deploy
script:
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
- ssh-add <(echo -e “$SSH_PRIVATE_KEY”)
- gem install capistrano
- cap staging deploy
only:
- develop
deploy:
environment: production
stage: deploy
script:
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
- ssh-add <(echo -e “$SSH_PRIVATE_KEY”)
- gem install capistrano
- cap staging deploy
only:
- master
@ipepe
Copy link

ipepe commented Sep 1, 2018

I think that in line 27 You should have cap production deploy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment