From ac83d2be602bc2f1cd539d9f10b0dd00bbe0e77c Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Tue, 6 Sep 2022 15:09:29 +0000 Subject: [PATCH 1/7] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..64b372d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,49 @@ +# This file is a template, and might need editing before it works on your project. +# This is a sample GitLab CI/CD configuration file that should run without any modifications. +# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts, +# it uses echo commands to simulate the pipeline execution. +# +# A pipeline is composed of independent jobs that run scripts, grouped into stages. +# Stages run in sequential order, but jobs within stages run in parallel. +# +# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages +# +# You can copy and paste this template into a new `.gitlab-ci.yml` file. +# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword. +# +# To contribute improvements to CI/CD templates, please follow the Development guide at: +# https://docs.gitlab.com/ee/development/cicd/templates.html +# This specific template is located at: +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml + +stages: # List of stages for jobs, and their order of execution + - build + - test + - deploy + +build-job: # This job runs in the build stage, which runs first. + stage: build + script: + - echo "Compiling the code..." + - echo "Compile complete." + +unit-test-job: # This job runs in the test stage. + stage: test # It only starts when the job in the build stage completes successfully. + script: + - echo "Running unit tests... This will take about 60 seconds." + - sleep 60 + - echo "Code coverage is 90%" + +lint-test-job: # This job also runs in the test stage. + stage: test # It can run at the same time as unit-test-job (in parallel). + script: + - echo "Linting code... This will take about 10 seconds." + - sleep 10 + - echo "No lint issues found." + +deploy-job: # This job runs in the deploy stage. + stage: deploy # It only runs when *both* jobs in the test stage complete successfully. + environment: production + script: + - echo "Deploying application..." + - echo "Application successfully deployed." From 048908756225011068692e54e33e1ec958e9b1e5 Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Tue, 6 Sep 2022 15:25:32 +0000 Subject: [PATCH 2/7] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64b372d..a71919e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,22 +24,13 @@ stages: # List of stages for jobs, and their order of execution build-job: # This job runs in the build stage, which runs first. stage: build script: - - echo "Compiling the code..." - - echo "Compile complete." + - cd frontend && npm install + - cd backend && dotnet restore unit-test-job: # This job runs in the test stage. stage: test # It only starts when the job in the build stage completes successfully. script: - - echo "Running unit tests... This will take about 60 seconds." - - sleep 60 - - echo "Code coverage is 90%" - -lint-test-job: # This job also runs in the test stage. - stage: test # It can run at the same time as unit-test-job (in parallel). - script: - - echo "Linting code... This will take about 10 seconds." - - sleep 10 - - echo "No lint issues found." + - cd frontend && npm test deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. From 18dea4aabd8c82b47ab805a7f110a1662cf87c82 Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Tue, 6 Sep 2022 15:26:49 +0000 Subject: [PATCH 3/7] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a71919e..f2860ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,13 +24,13 @@ stages: # List of stages for jobs, and their order of execution build-job: # This job runs in the build stage, which runs first. stage: build script: - - cd frontend && npm install - - cd backend && dotnet restore + - npm install + - dotnet restore unit-test-job: # This job runs in the test stage. stage: test # It only starts when the job in the build stage completes successfully. script: - - cd frontend && npm test + - npm test deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. From fee1c292559bc1d0549c899b5f26f337fc6b9f35 Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Tue, 6 Sep 2022 15:31:10 +0000 Subject: [PATCH 4/7] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f2860ae..4347b97 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,6 +30,7 @@ build-job: # This job runs in the build stage, which runs first. unit-test-job: # This job runs in the test stage. stage: test # It only starts when the job in the build stage completes successfully. script: + - dotnet run - npm test deploy-job: # This job runs in the deploy stage. From 204e30b1ca8c34b41e3490eedc8cb9ed36abc7db Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Tue, 6 Sep 2022 15:32:46 +0000 Subject: [PATCH 5/7] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4347b97..401ce1b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,14 +24,14 @@ stages: # List of stages for jobs, and their order of execution build-job: # This job runs in the build stage, which runs first. stage: build script: - - npm install - - dotnet restore + - cd Frontend && npm install + - cd Backend && dotnet restore unit-test-job: # This job runs in the test stage. stage: test # It only starts when the job in the build stage completes successfully. script: - - dotnet run - - npm test + - cd Backend && dotnet run + - cd Frontend && npm test deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. From 60d02208b134810483580acf778ea3e039bc59b3 Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Tue, 6 Sep 2022 15:34:19 +0000 Subject: [PATCH 6/7] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 401ce1b..a306c18 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,14 +24,14 @@ stages: # List of stages for jobs, and their order of execution build-job: # This job runs in the build stage, which runs first. stage: build script: - - cd Frontend && npm install - - cd Backend && dotnet restore + - cd Frontend && npm install && cd .. + - cd Backend && dotnet restore && cd .. unit-test-job: # This job runs in the test stage. stage: test # It only starts when the job in the build stage completes successfully. script: - - cd Backend && dotnet run - - cd Frontend && npm test + - cd Backend && dotnet run && cd .. + - cd Frontend && npm test && cd .. deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. From bdc9ef97451ea3097abb411b9a0669224f8b68ec Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Tue, 6 Sep 2022 15:37:50 +0000 Subject: [PATCH 7/7] Removed .gitlab-ci.yml file --- .gitlab-ci.yml | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a306c18..e69de29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,41 +0,0 @@ -# This file is a template, and might need editing before it works on your project. -# This is a sample GitLab CI/CD configuration file that should run without any modifications. -# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts, -# it uses echo commands to simulate the pipeline execution. -# -# A pipeline is composed of independent jobs that run scripts, grouped into stages. -# Stages run in sequential order, but jobs within stages run in parallel. -# -# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages -# -# You can copy and paste this template into a new `.gitlab-ci.yml` file. -# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword. -# -# To contribute improvements to CI/CD templates, please follow the Development guide at: -# https://docs.gitlab.com/ee/development/cicd/templates.html -# This specific template is located at: -# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml - -stages: # List of stages for jobs, and their order of execution - - build - - test - - deploy - -build-job: # This job runs in the build stage, which runs first. - stage: build - script: - - cd Frontend && npm install && cd .. - - cd Backend && dotnet restore && cd .. - -unit-test-job: # This job runs in the test stage. - stage: test # It only starts when the job in the build stage completes successfully. - script: - - cd Backend && dotnet run && cd .. - - cd Frontend && npm test && cd .. - -deploy-job: # This job runs in the deploy stage. - stage: deploy # It only runs when *both* jobs in the test stage complete successfully. - environment: production - script: - - echo "Deploying application..." - - echo "Application successfully deployed."