Skip to content

Instantly share code, notes, and snippets.

@harimau99
Forked from shaliko/.gitlab-ci.yml
Created September 12, 2019 08:54
Show Gist options
  • Save harimau99/283d92376d3dce254aba4b8841a44244 to your computer and use it in GitHub Desktop.
Save harimau99/283d92376d3dce254aba4b8841a44244 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment