Browse Source

Merge pull request #10 from jootha/circleci-project-setup

Etape 7
main
LecomteAdrien 6 years ago
committed by GitHub
parent
commit
2e3fbf4f04
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      .circleci/config.yml
  2. 5
      dockerfile

26
.circleci/config.yml

@ -12,6 +12,12 @@ workflows:
- db:
requires:
- build
- dockerhub:
requires:
- build
- lint
- tests
jobs:
build:
@ -73,4 +79,22 @@ jobs:
- save_cache:
key: yarn-packages-v3{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- ./node_modules
dockerhub:
environment:
IMAGE_NAME: jootha/devops-ci
docker:
- image: circleci/buildpack-deps:stretch
steps:
- checkout
- setup_remote_docker
- run: docker image build --tag $IMAGE_NAME:app .
- run:
name: Publish Docker Image to Docker Hub
command: |
echo "$DOCKERHUB_PASS" | docker login -u alecomte -p a86a2e77-25ec-4cd2-b060-c55987957ca4
docker tag $IMAGE_NAME:app $IMAGE_NAME:$CIRCLE_BUILD_NUM
docker tag $IMAGE_NAME:app $IMAGE_NAME:latest

5
dockerfile

@ -0,0 +1,5 @@
FROM node:12.18.4
COPY ["package.json", "yarn.lock", "./"]
RUN yarn install
COPY . .
CMD ["yarn", "start"]
Loading…
Cancel
Save