From 205a98bcd2f4ca601f503535c7a7322b998d8d0a Mon Sep 17 00:00:00 2001 From: LecomteAdrien Date: Thu, 5 Nov 2020 14:54:33 +0100 Subject: [PATCH] stepe 7 : dockerhub --- .circleci/config.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fff7c76..31dc355 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,12 @@ workflows: - db: requires: - build + - dockerhub: + requires: + - build + - lint + - tests + jobs: build: @@ -73,4 +79,26 @@ jobs: - save_cache: key: yarn-packages-v3{{ checksum "yarn.lock" }} paths: - - ./node_modules \ No newline at end of file + - ./node_modules + dockerhub: + environment: + IMAGE_NAME: jonathancardoso/building-on-ci + docker: + - image: circleci/buildpack-deps:stretch + steps: + - checkout + - setup_remote_docker + - run: docker image build --tag $IMAGE_NAME:app . + - run: + command: | + echo "$DOCKERHUB_PASS" | docker login --username sgttabouret --password-stdin + docker tag $IMAGE_NAME:app $IMAGE_NAME:$CIRCLE_BUILD_NUM + docker tag $IMAGE_NAME:app $IMAGE_NAME:latest + docker push $IMAGE_NAME:latest + docker push $IMAGE_NAME:$CIRCLE_BUILD_NUM + + + + + + \ No newline at end of file