Last active
January 11, 2016 07:59
-
-
Save dlupu/1597e94f8bb986d6495a to your computer and use it in GitHub Desktop.
Script I use to automatically deploy code to https://scalingo.com/ from https://semaphoreci.com/
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
### THIS SCRIPT IS EXECUTED IN THE APP ROOT FOLDER ### | |
# be sure scalingo.com is a known ssh host 00:00 | |
ssh-keyscan -H -p 22 scalingo.com >> ~/.ssh/known_hosts | |
# install Scalingo CLO | |
curl -O https://cli-dl.scalingo.io/install && bash install | |
# DPL is a deploy tool made for continuous deployment (ruby) | |
gem install dpl | |
# Setup the `staging` git remote if its missing | |
git remote add staging [email protected]:my-app.git || true # replace with your git repository | |
# This will push the `master` branch to `staging` git remote | |
dpl --provider=scalingo --api_key="XXXXX" --remote=staging # replace with your `api_key` from https://my.scalingo.com/profile | |
# HACK previous command has also logged us in into the CLI so we can use it from now on | |
# RUN the migrations | |
scalingo --remote staging run bundle exec rake db:migrate | |
# Restart containes | |
scalingo --remote staging restart | |
# Add here other commands like (e.g. notify newrelic a deploy has just been made) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment