|
|
|
@ -15,6 +15,7 @@ jobs: |
|
|
|
paths: |
|
|
|
- node_modules |
|
|
|
key: dependencies-{{ checksum "package.json" }}-v1 |
|
|
|
|
|
|
|
testUnit: |
|
|
|
<<: *shared-config |
|
|
|
steps: |
|
|
|
@ -22,7 +23,27 @@ jobs: |
|
|
|
- restore_cache: |
|
|
|
key: dependencies-{{ checksum "package.json" }}-v1 |
|
|
|
- run: yarn test:unit |
|
|
|
server-doc-deploy: |
|
|
|
|
|
|
|
docker-build-and-push: |
|
|
|
working_directory: /dockerapp |
|
|
|
docker: |
|
|
|
- image: docker:17.05.0-ce-git |
|
|
|
steps: |
|
|
|
- checkout |
|
|
|
- setup_remote_docker |
|
|
|
- run: |
|
|
|
name: Build application Docker image |
|
|
|
command: docker build -t app . |
|
|
|
- deploy: |
|
|
|
name: Publish application to docker hub |
|
|
|
command: | |
|
|
|
docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD |
|
|
|
docker tag app $DOCKER_HUB_USER_ID/tp_final_backend_six:$CIRCLE_BUILD_NUM |
|
|
|
docker tag app $DOCKER_HUB_USER_ID/tp_final_backend_six:latest |
|
|
|
docker push $DOCKER_HUB_USER_ID/tp_final_backend_six:$CIRCLE_BUILD_NUM |
|
|
|
docker push $DOCKER_HUB_USER_ID/tp_final_backend_six:latest |
|
|
|
|
|
|
|
server-deploy: |
|
|
|
<<: *shared-config |
|
|
|
working_directory: ~/repo |
|
|
|
steps: |
|
|
|
@ -43,7 +64,14 @@ workflows: |
|
|
|
- testUnit: |
|
|
|
requires: |
|
|
|
- build |
|
|
|
- server-doc-deploy: |
|
|
|
- docker-build-and-push: |
|
|
|
requires: |
|
|
|
- build |
|
|
|
- testUnit |
|
|
|
filters: |
|
|
|
branches: |
|
|
|
only: main |
|
|
|
- server-deploy: |
|
|
|
requires: |
|
|
|
- build |
|
|
|
- testUnit |
|
|
|
|