Browse Source

🔧 Add CircleCI folder and config file.

main
Pierre Fontaine 5 years ago
parent
commit
65c3c2c40b
  1. 46
      .circleci/config.yml
  2. 3
      .gitignore

46
.circleci/config.yml

@ -0,0 +1,46 @@
version: 2
jobs:
install:
docker:
- image: circleci/node:12.18.4
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- dependencies-
- run:
name: Install dependencies
command: yarn install
- save_cache:
key: dependencies-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
docker-build-and-push:
docker:
- image: docker:17.05.0-ce-git
steps:
- checkout
- setup_remote_docker
- run:
name: Build application Docker image
command: |
docker build --cache-from=app -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/devops-back-final:$CIRCLE_BUILD_NUM
docker tag app $DOCKER_HUB_USER_ID/devops-back-final:latest
docker push $DOCKER_HUB_USER_ID/devops-back-final:$CIRCLE_BUILD_NUM
docker push $DOCKER_HUB_USER_ID/devops-back-final:latest
workflows:
version: 2
build-test:
jobs:
- install
- docker-build-and-push:
requires:
- install

3
.gitignore

@ -22,3 +22,6 @@ yarn-error.log*
# Coverage Reports
coverage
# Local Netlify folder
.netlify
Loading…
Cancel
Save