Browse Source

🚧 Add deploy heroku dev environment

pull/5/head
anthony 5 years ago
parent
commit
2ec661f780
  1. 25
      .circleci/config.yml

25
.circleci/config.yml

@ -11,6 +11,9 @@ globals:
user-id: &dockerhub-user-id anthonyjhoiro
password: &dockerhub-password $DOCKERHUB_PASSWORD
image: &dockerhub-image devops-tpfinal-back
heroku:
main: &heroku-app-main tpfinal-devops-back
develop: &heroku-app-dev tpfinal-devops-back-dev
# --- Commands --- #
@ -107,13 +110,14 @@ jobs:
docker tag app $DOCKER_HUB_USER_ID/$DOCKER_HUB_IMAGE:$tag
docker push $DOCKER_HUB_USER_ID/$DOCKER_HUB_IMAGE:$tag
done
# docker tag app $DOCKER_HUB_USER_ID/$DOCKER_HUB_IMAGE:$CIRCLE_BUILD_NUM
#
# docker push $DOCKER_HUB_USER_ID/$DOCKER_HUB_IMAGE:latest
deploy-heroku:
<<: *shared-config
parameters:
heroku-app:
default: ""
type: string
docker:
- image: buildpack-deps:trusty
auth:
@ -123,11 +127,11 @@ jobs:
- setup_dependencies
- run:
name: Heroku Deploy
command: git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:main
command: git push https://heroku:$HEROKU_API_KEY@git.heroku.com/<<parameters.heroku-app>>.git HEAD:main
- run:
name: Smoke Test
command: |
HTTPCODE=`curl -s -o /dev/null -w "%{http_code}" https://$HEROKU_APP_NAME.herokuapp.com/`
HTTPCODE=`curl -s -o /dev/null -w "%{http_code}" https://<<parameters.heroku-app>>.herokuapp.com/`
if [ "$HTTPCODE" -ne 200 ];then
echo "heroku app not responding, failing deploy"
exit 1
@ -173,6 +177,7 @@ workflows:
- develop
- deploy-heroku:
heroku-app: *heroku-app-main
requires:
- test
- test-e2e
@ -181,3 +186,13 @@ workflows:
branches:
only:
- main
- deploy-heroku:
heroku-app: *heroku-app-dev
requires:
- test
- test-e2e
- lint
# filters:
# branches:
# only:
# - develop
Loading…
Cancel
Save