Skip to content

Commit

Permalink
circle ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhantoroev committed May 25, 2022
1 parent 679cf15 commit 68955ca
Showing 1 changed file with 28 additions and 49 deletions.
77 changes: 28 additions & 49 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,31 @@
on: 2.1
orbs:
docker: circleci/docker@1.5.0
version: 2.1
executors:
docker:
environment:
IMAGE_NAME: smz001/robofriends
docker:
- image: circleci/buildpack-deps:stretch
docker-publisher:
environment:
IMAGE_NAME: ndukwearm19docker/docker-node-app
docker: # Each job requires specifying an executor
# (either docker, macos, or machine), see
— image: circleci/node:latest
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASS
jobs:
build:
executor: docker
steps:
- checkout
- setup_remote_docker
- run:
name: Build Docker image
command: |
docker build -t $IMAGE_NAME:latest .
- run:
name: Archive Docker image
command: docker save -o image.tar $IMAGE_NAME
- persist_to_workspace:
root: .
paths:
- ./image.tar
docker:
executor: docker
steps:
- attach_workspace:
at: /tmp/workspace
- setup_remote_docker
- run:
name: Load archived Docker image
command: docker load -i /tmp/workspace/image.tar
- run:
name: Publish Docker Image to Docker Hub
command: |
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
docker push $IMAGE_NAME:latest
publishLatestToHub:
executor: docker-publisher

steps:
— checkout
— setup_remote_docker
— run:
name: Publish Docker Image to Docker Hub
command: |
echo “$DOCKERHUB_PASSWORD” | docker login -u “$DOCKERHUB_USERNAME” — password-stdin
docker build -t $IMAGE_NAME .
docker push $IMAGE_NAME:latest
workflows:
version: 2
build-master:
jobs:
- build:
filters:
branches:
only: master
- docker:
requires:
- build
filters:
branches:
only: master
version: 2
build-master:
jobs:
— publishLatestToHub

0 comments on commit 68955ca

Please sign in to comment.