Last active
November 30, 2017 15:37
-
-
Save sadikay/16795e28e37aafeb30d7384c7335fdfd to your computer and use it in GitHub Desktop.
Multi branch deploy gitlab side
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: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