Skip to content

Commit

Permalink
ci(circleci-build): fix sample file
Browse files Browse the repository at this point in the history
  • Loading branch information
mmpetarpeshev committed Oct 4, 2021
1 parent 909e9ea commit cda372c
Showing 1 changed file with 17 additions and 60 deletions.
77 changes: 17 additions & 60 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,26 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

executors:
docker_builder:
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
say-hello:
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
- image: circleci/buildpack-deps:bionic
user: root

references:
docker_parameters: &docker_parameters
DOCKERHUB_REPO:
type: string
APP_NAME:
type: string
DOCKER_FILE:
type: string

commands:
docker_build:
parameters: *docker_parameters
- image: cimg/base:stable
# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Build and push Docker image to DockerHub
command: |
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker build -t << parameters.DOCKERHUB_REPO >>:${CIRCLE_TAG:-master} -f << parameters.DOCKER_FILE >> .
docker push << parameters.DOCKERHUB_REPO >>:${CIRCLE_TAG:-master}
jobs:
docker_push_tag:
parameters: *docker_parameters
executor: docker_builder
steps:
- docker_build:
DOCKERHUB_REPO: << parameters.DOCKERHUB_REPO >>
APP_NAME: << parameters.APP_NAME >>
DOCKER_FILE: << parameters.DOCKER_FILE >>
name: "Say hello"
command: "echo Hello, World!"

# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
version: 2
build_push:
say-hello-workflow:
jobs:
- docker_push_tag:
name: docker_push_tag_web
DOCKERHUB_REPO: "aeternity/superhero-ui" // what should be the same image or different tag ?
APP_NAME: "aggregator"
DOCKER_FILE: nginx.Dockerfile
context: ae-dockerhub
filters:
branches:
only:
- features/circleci-config
tags:
only: /^v.*$/
- docker_push_tag:
name: docker_push_tag_ssr
DOCKERHUB_REPO: "aeternity/superhero-ui"
APP_NAME: ""
DOCKER_FILE: Dockerfile
context: ae-dockerhub
filters:
branches:
only:
- features/circleci-config
tags:
only: /^v.*$/
- say-hello

0 comments on commit cda372c

Please sign in to comment.