From cda372c7bcbee9c223dfb60fbab46529b0b92bb1 Mon Sep 17 00:00:00 2001 From: Petar Peshev Date: Mon, 4 Oct 2021 21:13:39 +0300 Subject: [PATCH] ci(circleci-build): fix sample file --- .circleci/config.yml | 77 ++++++++++---------------------------------- 1 file changed, 17 insertions(+), 60 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d620ce0a6..6554e1f4e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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