From 22143e7e9361fe3d1df3541cc503b68e17313ca7 Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Mon, 6 Sep 2021 23:14:56 +0300 Subject: [PATCH 01/14] Add .circleci/config.yml --- .circleci/config.yml | 62 +++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6a532cb..ca346cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,41 +1,31 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference version: 2.1 - +# Use a package of configuration called an orb. orbs: - # The python orb contains a set of prepackaged CircleCI configuration you can use repeatedly in your configuration files - # Orb commands and jobs help you with common scripting around a language/tool - # so you dont have to copy and paste it everywhere. - # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python - python: circleci/python@1.2 - + # Declare a dependency on the welcome-orb + welcome: circleci/welcome-orb@0.4.1 +# Orchestrate or schedule a set of jobs +jobs: + print_hello: + docker: + - image: circleci/node:13.8.0 + steps: + - run: + command: + echo "hello" +print_world: + docker: + - image: circleci/node:13.8.0 + steps: + - run: + command: + echo "world" workflows: - sample: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. - # For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/2.0/configuration-reference/#workflows + # Name the workflow "welcome" + default: + # Run the welcome/run job in its own container jobs: - - build-and-test + - print_hello + - print_world: + requires: [print_hello] - -jobs: - build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do! - # These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/ - # You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub - # A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python - # The executor is the environment in which the steps below will be executed - below will use a python 3.9 container - # Change the version below to your required version of python - docker: - - image: cimg/python:3.8 - # Checkout the code as the first step. This is a dedicated CircleCI step. - # The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default. - # Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt. - # Then run your tests! - # CircleCI will report the results back to your VCS provider. - steps: - - checkout - - python/install-packages: - pkg-manager: pip - # app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory. - # pip-dependency-file: test-requirements.txt # if you have a different name for your requirements file, maybe one that combines your runtime and test requirements. - - run: - name: Run tests - # This assumes pytest is installed via the install-package step above - command: pytest From a861316a51fe3c11cd5fc0904b1d1273c930c04a Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Tue, 7 Sep 2021 00:19:50 +0300 Subject: [PATCH 02/14] Add .circleci/config.yml --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca346cf..9292569 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,13 +11,15 @@ jobs: - image: circleci/node:13.8.0 steps: - run: + name: print_hello command: echo "hello" -print_world: + print_world: docker: - image: circleci/node:13.8.0 steps: - run: + name: print_world command: echo "world" workflows: From 2e1f2bdcf2ae78957e0e83834a9c0aebb22fbace Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Tue, 7 Sep 2021 00:24:53 +0300 Subject: [PATCH 03/14] Updated config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9292569..0eef699 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,4 +30,5 @@ workflows: - print_hello - print_world: requires: [print_hello] +#Thanks From 11717f29a09aea2a55ba5fd8968b4ace3abcdf96 Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Tue, 7 Sep 2021 01:32:07 +0300 Subject: [PATCH 04/14] Updated config.yml --- .circleci/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0eef699..bb771ac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,6 +22,13 @@ jobs: name: print_world command: echo "world" + print_context_name: + docker: + - image: circleci/node:13.8.0 + steps: + - run: + command: + echo $MY_CONTEXT_NAME workflows: # Name the workflow "welcome" default: @@ -30,5 +37,6 @@ workflows: - print_hello - print_world: requires: [print_hello] + - print_context_name #Thanks From 230f920b42d966cc1cc6bec84bcb00b2418d5d74 Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Wed, 8 Sep 2021 23:45:52 +0300 Subject: [PATCH 05/14] Add .circleci/config.yml --- .circleci/config.yml | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bb771ac..bfaaf5b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,37 +6,35 @@ orbs: welcome: circleci/welcome-orb@0.4.1 # Orchestrate or schedule a set of jobs jobs: - print_hello: + save_hello_world_output: docker: - image: circleci/node:13.8.0 steps: - run: - name: print_hello + name: caching command: - echo "hello" - print_world: + echo "hello world" > output.txt + - persist_to_workspace: + root: /tmp/workspace + paths: + - build/* + print_output_file: docker: - image: circleci/node:13.8.0 steps: + - attach_workspace: + at: /tmp/workspace - run: - name: print_world + name: output workspace command: - echo "world" - print_context_name: - docker: - - image: circleci/node:13.8.0 - steps: - - run: - command: - echo $MY_CONTEXT_NAME + cat output.txt workflows: # Name the workflow "welcome" default: # Run the welcome/run job in its own container jobs: - - print_hello - - print_world: - requires: [print_hello] - - print_context_name -#Thanks + - save_hello_world_output + - print_output_file: + requires: + - save_hello_world_output From 33b39b276b8682f4193cfa0debcbe4d848a2042b Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Wed, 8 Sep 2021 23:51:44 +0300 Subject: [PATCH 06/14] Updated config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bfaaf5b..c461e3e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: command: echo "hello world" > output.txt - persist_to_workspace: - root: /tmp/workspace + root: /circleci/test paths: - build/* print_output_file: @@ -23,7 +23,7 @@ jobs: - image: circleci/node:13.8.0 steps: - attach_workspace: - at: /tmp/workspace + at: /circleci/test - run: name: output workspace command: From 36a2be497545e72621af518e331c7589b5d68807 Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Wed, 8 Sep 2021 23:55:34 +0300 Subject: [PATCH 07/14] Updated config.yml --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c461e3e..f37f7ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,15 +15,15 @@ jobs: command: echo "hello world" > output.txt - persist_to_workspace: - root: /circleci/test + root: ~/ paths: - - build/* + - output.txt print_output_file: docker: - image: circleci/node:13.8.0 steps: - attach_workspace: - at: /circleci/test + at: ~/ - run: name: output workspace command: From 177296d346c5c3ff4751f1cad279c96c93e471d6 Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Thu, 9 Sep 2021 00:01:44 +0300 Subject: [PATCH 08/14] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f37f7ef..0297307 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ jobs: - run: name: caching command: - echo "hello world" > output.txt + echo "hello world" > ~/output.txt - persist_to_workspace: root: ~/ paths: From ea3e8a527e0e9ac4f7e01efcf144b49a0ec0fd55 Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Thu, 9 Sep 2021 00:04:28 +0300 Subject: [PATCH 09/14] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0297307..218d441 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,7 +27,7 @@ jobs: - run: name: output workspace command: - cat output.txt + cat ~/output.txt workflows: # Name the workflow "welcome" default: From 4404305b5ecae07906569478a32a9134ad257f4f Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Thu, 9 Sep 2021 01:32:58 +0300 Subject: [PATCH 10/14] Updated config.yml --- .circleci/config.yml | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 218d441..dedf7f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,40 +1,21 @@ # Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference version: 2.1 # Use a package of configuration called an orb. -orbs: - # Declare a dependency on the welcome-orb - welcome: circleci/welcome-orb@0.4.1 -# Orchestrate or schedule a set of jobs +commands: + print_pipeline_id: + description: "A very simple command for demonstration purposes" + steps: + - run: echo ${CIRCLE_WORKFLOW_ID} jobs: - save_hello_world_output: + illustrate_commands: docker: - image: circleci/node:13.8.0 steps: - - run: - name: caching - command: - echo "hello world" > ~/output.txt - - persist_to_workspace: - root: ~/ - paths: - - output.txt - print_output_file: - docker: - - image: circleci/node:13.8.0 - steps: - - attach_workspace: - at: ~/ - - run: - name: output workspace - command: - cat ~/output.txt + - print_pipeline_id: workflows: # Name the workflow "welcome" default: # Run the welcome/run job in its own container jobs: - - save_hello_world_output - - print_output_file: - requires: - - save_hello_world_output + - illustrate_commands From b9cb129cf2f045b933101cb9a32bea86e66380b6 Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Thu, 9 Sep 2021 01:49:05 +0300 Subject: [PATCH 11/14] Updated config.yml --- .circleci/config.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dedf7f0..5da089d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,15 +3,14 @@ version: 2.1 # Use a package of configuration called an orb. commands: print_pipeline_id: - description: "A very simple command for demonstration purposes" steps: - - run: echo ${CIRCLE_WORKFLOW_ID} + - run: echo ${CIRCLE_WORKFLOW_ID} jobs: - illustrate_commands: - docker: + illustrate_commands: + docker: - image: circleci/node:13.8.0 - steps: - - print_pipeline_id: + steps: + - print_pipeline_id workflows: # Name the workflow "welcome" default: From 68129c66b189642ebcc5ad2c420697c424933aef Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Thu, 9 Sep 2021 12:49:43 +0300 Subject: [PATCH 12/14] Updated config.yml --- .circleci/config.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5da089d..82021c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,14 +3,18 @@ version: 2.1 # Use a package of configuration called an orb. commands: print_pipeline_id: + parameters: + id: + type: string steps: - - run: echo ${CIRCLE_WORKFLOW_ID} + - run: echo << parameters.id >> jobs: illustrate_commands: docker: - image: circleci/node:13.8.0 steps: - - print_pipeline_id + - print_pipeline_id: + id: ${CIRCLE_WORKFLOW_ID} workflows: # Name the workflow "welcome" default: From 265a4c89cc86893b26807b5f1d3c235c4f800276 Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Thu, 9 Sep 2021 13:35:40 +0300 Subject: [PATCH 13/14] Updated config.yml --- .circleci/config.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 82021c6..543d417 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,24 +1,24 @@ # Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference version: 2.1 # Use a package of configuration called an orb. -commands: - print_pipeline_id: - parameters: - id: - type: string - steps: - - run: echo << parameters.id >> -jobs: - illustrate_commands: +defaults: &defaults docker: - image: circleci/node:13.8.0 +jobs: + illustrate_commands: + <<: *defaults steps: - - print_pipeline_id: - id: ${CIRCLE_WORKFLOW_ID} + - run: + echo ${CIRCLE_WORKFLOW_if} + error_check: + <<: *defaults + steps: + - checkout + - run: + command: echo "Hello error" + when: on_fail workflows: - # Name the workflow "welcome" - default: - # Run the welcome/run job in its own container - jobs: - - illustrate_commands - + default: + jobs: + - illustrate_commands + - error_check From 75295820eebbb58f4ab0ab76617ebf4b3f0ee057 Mon Sep 17 00:00:00 2001 From: CloudEngineer20 <71173913+CloudEngineer20@users.noreply.github.com> Date: Thu, 9 Sep 2021 13:40:12 +0300 Subject: [PATCH 14/14] Updated config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 543d417..a648788 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,7 @@ jobs: illustrate_commands: <<: *defaults steps: + - run: return 1 - run: echo ${CIRCLE_WORKFLOW_if} error_check: