Update .gitlab-ci.yml file
This commit is contained in:
+9
-6
@@ -21,12 +21,11 @@ stages: # List of stages for jobs, and their order of execution
|
||||
- test
|
||||
- deploy
|
||||
|
||||
services:
|
||||
- docker:dind
|
||||
|
||||
build-job: # This job runs in the build stage, which runs first.
|
||||
stage: build
|
||||
image: docker:latest
|
||||
image: docker:27.5.1-cli
|
||||
services:
|
||||
- docker:dind
|
||||
script:
|
||||
- cd ./app
|
||||
- echo "Compiling the code..."
|
||||
@@ -35,16 +34,20 @@ 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.
|
||||
image: npm:latest
|
||||
image: node:22
|
||||
script:
|
||||
- cd ./app
|
||||
- echo "Installing dependencies..."
|
||||
- npm install
|
||||
- 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
|
||||
image: docker:27.5.1-cli
|
||||
services:
|
||||
- docker:dind
|
||||
environment: production
|
||||
script:
|
||||
- cd ./app
|
||||
|
||||
Reference in New Issue
Block a user