From 4c45c983a5a966fe284f34edd6c5e2a1707e9295 Mon Sep 17 00:00:00 2001 From: odweta Date: Mon, 7 Sep 2026 18:48:44 +0200 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c6678e5..0d60c55 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,35 +17,34 @@ # 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 - - prepare - build - test - deploy -prepare-job: - stage: prepare - script: - - apt install docker - - apt install npm - build-job: # This job runs in the build stage, which runs first. stage: build + image: docker:latest script: + - cd ./app - echo "Compiling the code..." - docker compose build - 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. + image: npm:latest script: + - cd ./app - echo "Running unit tests..." - npm test - echo "Code coverage is 90%" deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. + image: docker:latest environment: production script: + - cd ./app - echo "Deploying application..." - docker compose up - echo "Application successfully deployed."