circleci: Separate build from deploy

This commit is contained in:
Jonatan Nilsson 2018-07-16 22:57:38 +00:00
parent ba4a3aca29
commit 5818e93289

View file

@ -6,9 +6,6 @@ jobs:
environment: environment:
- di: "nfpis/nfpis" - di: "nfpis/nfpis"
- dtag: "latest" - dtag: "latest"
- service_name: "nfpis"
- target_port: "7021" # The target port on the docker software
- service_port: "3000" # The exposed public port
working_directory: ~/nfpis working_directory: ~/nfpis
steps: steps:
- run: - run:
@ -24,6 +21,20 @@ jobs:
command: | command: |
docker login -u $DOCKER_USER -p $DOCKER_PASS docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push ${di} docker push ${di}
deploy:
docker:
- image: docker:latest
environment:
- di: "nfpis/nfpis"
- dtag: "latest"
- service_name: "nfpis"
- target_port: "7021" # The public target port on the docker host
- service_port: "3000" # The exposed port on the docker
working_directory: ~/nfpis
steps:
- run:
name: Update and install SSH & Git
command: apk update && apk upgrade && apk add --no-cache bash openssh
- deploy: - deploy:
name: Deploy to production name: Deploy to production
command: | command: |
@ -42,3 +53,13 @@ workflows:
jobs: jobs:
- build: - build:
context: org-global context: org-global
filters:
branches:
only: master
- deploy:
context: org-global
requires:
- build
filters:
branches:
only: master