Browse Source

👷 update CI

main
Tarskan 5 years ago
parent
commit
e1d9118604
  1. 32
      .circleci/config.yml

32
.circleci/config.yml

@ -15,6 +15,7 @@ jobs:
paths: paths:
- node_modules - node_modules
key: dependencies-{{ checksum "package.json" }}-v1 key: dependencies-{{ checksum "package.json" }}-v1
testUnit: testUnit:
<<: *shared-config <<: *shared-config
steps: steps:
@ -22,7 +23,27 @@ jobs:
- restore_cache: - restore_cache:
key: dependencies-{{ checksum "package.json" }}-v1 key: dependencies-{{ checksum "package.json" }}-v1
- run: yarn test:unit - 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 <<: *shared-config
working_directory: ~/repo working_directory: ~/repo
steps: steps:
@ -43,7 +64,14 @@ workflows:
- testUnit: - testUnit:
requires: requires:
- build - build
- server-doc-deploy:
- docker-build-and-push:
requires:
- build
- testUnit
filters:
branches:
only: main
- server-deploy:
requires: requires:
- build - build
- testUnit - testUnit

Loading…
Cancel
Save