1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-17 05:15:36 +00:00

Fix deploy job and put into workflow

This commit is contained in:
2021-02-12 19:27:33 +00:00
parent 46919a2b1b
commit 396e4be5b3

View File

@@ -1,4 +1,15 @@
version: 2 version: 2
workflows: # Define a Workflow running the build job, then the deploy job
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master # Only deploys when the commit is on the Master branch
jobs: jobs:
build: build:
machine: true machine: true
@@ -7,22 +18,22 @@ jobs:
- run: | - run: |
bash bin/run-tests-with-docker.sh bash bin/run-tests-with-docker.sh
# https://github.com/circleci/circleci-docs/blob/master/jekyll/_cci1/continuous-deployment-with-heroku.md # https://github.com/circleci/circleci-docs/blob/master/jekyll/_cci1/continuous-deployment-with-heroku.md
deployment: deploy:
production: machine: true
branch: master steps:
commands: - checkout
- | - run: |
cat >~/.netrc <<EOF cat >~/.netrc <<EOF
machine api.heroku.com machine api.heroku.com
login $HEROKU_EMAIL login $HEROKU_EMAIL
password $HEROKU_TOKEN password $HEROKU_TOKEN
machine git.heroku.com machine git.heroku.com
login $HEROKU_EMAIL login $HEROKU_EMAIL
password $HEROKU_TOKEN password $HEROKU_TOKEN
EOF EOF
- chmod 600 ~/.netrc # Heroku cli complains about permissions without this chmod 600 ~/.netrc # Heroku cli complains about permissions without this
- heroku git:remote -a wrestlingapp heroku git:remote -a wrestlingapp
- git push heroku master git push heroku master
- sleep 20s sleep 20s
- heroku run rake db:migrate --app wrestlingapp heroku run rake db:migrate --app wrestlingapp