From 50e75a8600e6d5b6e7d34f5f91fbfdb1ae74c685 Mon Sep 17 00:00:00 2001 From: aml-mahmoud <43865983+aml-mahmoud@users.noreply.github.com> Date: Sat, 10 Dec 2022 19:03:46 +0200 Subject: [PATCH 1/8] Add .circleci/config.yml --- .circleci/config.yml | 54 ++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f28cb98c..6554e1f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,42 +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 -workflows: - version: 2 - build: - jobs: - - build - +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/2.0/configuration-reference/#jobs jobs: - build: - working_directory: ~/mern-starter + 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/node:10.16.3 - - image: mongo:4.2.0 + - image: cimg/base:stable + # Add steps to the job + # See: https://circleci.com/docs/2.0/configuration-reference/#steps steps: - checkout - run: - name: update-npm - command: 'sudo npm install -g npm@5' - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: install-npm-wee - command: npm install - - save_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - paths: - - ./node_modules - - run: - name: test - command: npm test - - run: - name: code-coverage - command: './node_modules/.bin/nyc report --reporter=text-lcov' - - store_artifacts: - path: test-results.xml - prefix: tests - - store_artifacts: - path: coverage - prefix: coverage - - store_test_results: - path: test-results.xml + name: "Say hello" + command: "echo Hello, World!" + +# Invoke jobs via workflows +# See: https://circleci.com/docs/2.0/configuration-reference/#workflows +workflows: + say-hello-workflow: + jobs: + - say-hello From 8ff8600f52d17ee6f69c9a7582a1d8d5a2caaa13 Mon Sep 17 00:00:00 2001 From: aml-mahmoud <43865983+aml-mahmoud@users.noreply.github.com> Date: Sat, 10 Dec 2022 19:05:58 +0200 Subject: [PATCH 2/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6eef16b4..02e17e56 100644 --- a/README.md +++ b/README.md @@ -244,3 +244,4 @@ This warning is visible only on development and totally harmless. This occurs to ## License MERN is released under the [MIT License](http://www.opensource.org/licenses/MIT). +##hello world for testing circleci with github From 1b17ea43679649bfc5b6a13500746ce18a9a9715 Mon Sep 17 00:00:00 2001 From: aml-mahmoud <43865983+aml-mahmoud@users.noreply.github.com> Date: Sat, 10 Dec 2022 19:17:21 +0200 Subject: [PATCH 3/8] update readmme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 02e17e56..3622d33c 100644 --- a/README.md +++ b/README.md @@ -244,4 +244,4 @@ This warning is visible only on development and totally harmless. This occurs to ## License MERN is released under the [MIT License](http://www.opensource.org/licenses/MIT). -##hello world for testing circleci with github +##hello world for testing circleci with github-- From d319790d0a26011a66335e5d93b30e15f341272c Mon Sep 17 00:00:00 2001 From: aml-mahmoud <43865983+aml-mahmoud@users.noreply.github.com> Date: Sat, 10 Dec 2022 21:03:34 +0200 Subject: [PATCH 4/8] Updated config.yml --- .circleci/config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6554e1f4..f9f2f7e8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,6 +17,20 @@ jobs: - run: name: "Say hello" command: "echo Hello, World!" + - run: echo "Hello, world!" > workspace/echo-output + - persist_to_workspace: + root: workspace + # Must be relative path from root + paths: + - echo-output + persist-workspace: + docker: + - image: cimg/base:stable + steps: + - attach_workspace: + at: workspace + - run: cat workspace/echo-output + # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows @@ -24,3 +38,4 @@ workflows: say-hello-workflow: jobs: - say-hello + - persist-workspace From 11315fc522227f3fcd96fbc8090b398929c7e51f Mon Sep 17 00:00:00 2001 From: aml-mahmoud <43865983+aml-mahmoud@users.noreply.github.com> Date: Sat, 10 Dec 2022 21:15:01 +0200 Subject: [PATCH 5/8] Updated config.yml --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f9f2f7e8..9ce73378 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,19 +17,19 @@ jobs: - run: name: "Say hello" command: "echo Hello, World!" - - run: echo "Hello, world!" > workspace/echo-output + - run: echo "Hello, world!" > ~/output.txt - persist_to_workspace: - root: workspace + root: ~/ # Must be relative path from root paths: - - echo-output + - output.txt persist-workspace: docker: - image: cimg/base:stable steps: - attach_workspace: - at: workspace - - run: cat workspace/echo-output + at: ~/ + - run: cat ~/output.txt # Invoke jobs via workflows From 19d6492940f24f8361037ab77ed152081c6d6c9b Mon Sep 17 00:00:00 2001 From: aml-mahmoud <43865983+aml-mahmoud@users.noreply.github.com> Date: Sat, 10 Dec 2022 21:18:02 +0200 Subject: [PATCH 6/8] 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 9ce73378..033516f8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,7 +29,7 @@ jobs: steps: - attach_workspace: at: ~/ - - run: cat ~/output.txt + - run: cat output.txt # Invoke jobs via workflows From c1f0fcbdb9c33404f4a95caf61069093859a93a4 Mon Sep 17 00:00:00 2001 From: aml-mahmoud <43865983+aml-mahmoud@users.noreply.github.com> Date: Sat, 10 Dec 2022 21:19:43 +0200 Subject: [PATCH 7/8] 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 033516f8..9ce73378 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,7 +29,7 @@ jobs: steps: - attach_workspace: at: ~/ - - run: cat output.txt + - run: cat ~/output.txt # Invoke jobs via workflows From 9cef0a46c6e1b8e168e6d1da6092efa616c8ca9e Mon Sep 17 00:00:00 2001 From: aml-mahmoud <43865983+aml-mahmoud@users.noreply.github.com> Date: Sat, 10 Dec 2022 21:22:51 +0200 Subject: [PATCH 8/8] Updated config.yml --- .circleci/config.yml | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9ce73378..054ecf78 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,40 +2,29 @@ # See: https://circleci.com/docs/2.0/configuration-reference version: 2.1 -# 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 + save_hello_world_output: docker: - - image: cimg/base:stable - # Add steps to the job - # See: https://circleci.com/docs/2.0/configuration-reference/#steps + - image: circleci/node:13.8.0 steps: - - checkout - - run: - name: "Say hello" - command: "echo Hello, World!" - - run: echo "Hello, world!" > ~/output.txt + - run: echo "hello world" > ~/output.txt - persist_to_workspace: - root: ~/ - # Must be relative path from root + root: ~/ paths: - - output.txt - persist-workspace: + - output.txt + + print_output_file: docker: - - image: cimg/base:stable + - image: circleci/node:13.8.0 steps: - attach_workspace: at: ~/ - - run: cat ~/output.txt - + - run: cat ~/output.txt -# Invoke jobs via workflows -# See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: - say-hello-workflow: + my_workflow: jobs: - - say-hello - - persist-workspace + - save_hello_world_output + - print_output_file: + requires: + - save_hello_world_output \ No newline at end of file