Browse Source

👷 Setup Heroku dev env

👷 Setup Heroku dev env
pull/7/head
Anthony Quéré 5 years ago
committed by GitHub
parent
commit
c4e90d89e8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      .circleci/config.yml

25
.circleci/config.yml

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