Skip to content

Instantly share code, notes, and snippets.

@sadikay
Last active November 30, 2017 15:37
Show Gist options
  • Save sadikay/16795e28e37aafeb30d7384c7335fdfd to your computer and use it in GitHub Desktop.
Save sadikay/16795e28e37aafeb30d7384c7335fdfd to your computer and use it in GitHub Desktop.
Multi branch deploy gitlab side
image: "ruby:2.3.3"
before_script:
- ruby -v
- which ruby
- gem install bundler --no-ri --no-rdoc
- bundle install --jobs $(nproc) "${FLAGS[@]}"
staging_deploy:
except:
- master
- stable
script:
- mkdir -p ~/.ssh
- touch ~/.ssh/known_hosts
- ssh-keyscan -H "$STAGING_SERVER_IP" >> ~/.ssh/known_hosts
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$DEPLOYER_PRIVATE_KEY")
- bundle exec cap production deploy BRANCH=$CI_COMMIT_REF_NAME VIA_ADMIN=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment