@@ -3,29 +3,31 @@ stages:
33 - build
44 - documentation
55
6- image :
7- node:20
8-
96workflow :
107 rules :
118 - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
129 - if : $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == 'main'
1310
14- before_script :
15- # Check for updates and install build-essential
16- - apt-get update -y
17- - apt-get upgrade -y
18- - apt-get install -y build-essential
19- # Print the exact versions of node and npm
20- - node --version
21- - npm --version
11+ default :
12+ image : node:20
13+ interruptible : true # All the jobs can be interrupted by newer pipelines
14+ before_script :
15+ # Check for updates and install build-essential
16+ - apt-get update -y
17+ - apt-get upgrade -y
18+ - apt-get install -y build-essential
19+ # Print the exact versions of node and npm
20+ - node --version
21+ - npm --version
2222
2323formatting :
2424 stage : formatting
2525 rules :
2626 # Run this stage only during pipelines associated to merge requests
2727 - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
2828 script :
29+ # Start the job
30+ - echo "Running job \"${CI_JOB_NAME}\" with the image \"${CI_JOB_IMAGE}\"..."
2931 # Install angular
3032 -
npm install -g @angular/[email protected] 3133 # Install the dependencies
@@ -42,20 +44,27 @@ formatting:
4244 echo "Run locally \`npm run prettier\` and commit the formatted files."
4345 exit 1
4446 fi
45- # Stage successfully completed
46- - echo "${CI_JOB_STAGE} stage successfully completed "
47+ # Job successfully completed
48+ - echo "Successfully completed job \"${CI_JOB_NAME}\" with the image \"${CI_JOB_IMAGE}\" "
4749
4850build :
4951 stage : build
52+ # Run this job using multiple node images
53+ image : $IMAGE
54+ parallel :
55+ matrix :
56+ - IMAGE : ['node:16', 'node:18', 'node:20'] # All the images we want to use
5057 script :
58+ # Start the job
59+ - echo "Running job \"${CI_JOB_NAME}\" with the image \"${CI_JOB_IMAGE}\"..."
5160 # Install angular
5261 -
npm install -g @angular/[email protected] 5362 # Install the dependencies
5463 - npm ci
5564 # Build the application
5665 - npm run build
57- # Stage successfully completed
58- - echo "${CI_JOB_STAGE} stage successfully completed "
66+ # Job successfully completed
67+ - echo "Successfully completed job \"${CI_JOB_NAME}\" with the image \"${CI_JOB_IMAGE}\" "
5968
6069documentation :
6170 stage : documentation
@@ -66,6 +75,8 @@ documentation:
6675 expose_as : ' sphinx documentation'
6776 when : on_success
6877 script :
78+ # Start the job
79+ - echo "Running job \"${CI_JOB_NAME}\" with the image \"${CI_JOB_IMAGE}\"..."
6980 # Install python3-venv and create a virtual environment
7081 - apt-get install -y python3-venv
7182 - python3 -m venv display-env
@@ -74,5 +85,5 @@ documentation:
7485 - pip3 install -r requirements-docs.txt
7586 # Build the documentation
7687 - sphinx-build docs/source/ docs/build
77- # Stage successfully completed
78- - echo "${CI_JOB_STAGE} stage successfully completed "
88+ # Job successfully completed
89+ - echo "Successfully completed job \"${CI_JOB_NAME}\" with the image \"${CI_JOB_IMAGE}\" "
0 commit comments