Skip to content

Commit

Permalink
Heroku (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
komalsingh54 committed Apr 12, 2020
1 parent e1eb74f commit 297e9b0
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 10 deletions.
89 changes: 80 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,89 @@
version: 2.1
orbs:
heroku: circleci/heroku@0.0.10
node: circleci/node@2.0.1

jobs:
build-and-test:
build:
executor:
name: node/default
steps:
- checkout
- node/with-cache:
steps:
- run: npm install
- run: npm test
- run: npm run build
- run: npm install
- run: npm run test
- run: npm run build

test:
executor:
name: node/default
steps:
- checkout
- run: npm install
- run: npm run test

deploy:
executor:
name: node/default
steps:
- checkout
- run: npm install
- run: npm run test
- run: npm run build
- run:
name: Deploy to Heroku
command: bash .circleci/heroku-setup.sh


syncBranch:
executor:
name: node/default
steps:
- checkout
- run:
name: Sync Downstream
command: yarn rhinodeploy merge -c build:production


workflows:
heroku_deploy:
version: 2

general:
jobs:
- test:
filters:
branches:
ignore:
- master
- develop

deployment:
jobs:
- heroku/deploy-via-git
- build:
filters:
branches:
only:
- master
- develop
- test:
filters:
branches:
only:
- master
- develop
- deploy:
requires:
- build
- test
filters:
branches:
only:
- master
- develop
#- syncBranch:
# requires:
# - deploy
# filters:
# branches:
# only:
# - master
# - staging
# - develop
17 changes: 17 additions & 0 deletions .circleci/heroku-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh

cat > ~/.netrc << EOF
machine api.heroku.com
login $HEROKU_LOGIN
password $HEROKU_API_KEY
machine git.heroku.com
login $HEROKU_LOGIN
password $HEROKU_API_KEY
EOF

echo $CIRCLE_BRANCH
echo $HEROKU_APP

heroku git:remote -a $HEROKU_APP
114 changes: 114 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 297e9b0

Please sign in to comment.