diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4f7b21e144607c323a8ed8ef8498666ade46afc0..eee948c22934b7f9a63150630a3598ce433cb4f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,34 +16,35 @@ stages: # List of stages for jobs, and their order of execution - test - build - - deploy image: node:latest +cache: + key: $CI_COMMIT_REF_SLUG + paths: + - .npm/ -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%" +before_script: + - npm ci --cache .npm --prefer-offline lint-test-job: stage: test script: - echo "Linting code with eslint." - - npm i eslint +# - npm i eslint - node_modules/eslint/bin/eslint.js . - -deploy-job: # This job runs in the deploy stage. - stage: deploy # It only runs when *both* jobs in the test stage complete successfully. +build-job: # This job runs in the build stage, which runs first. + stage: build script: - - echo "Deploying application..." - - echo "Application successfully deployed." + - npm run build + artifacts: + paths: + - release/knowledge-space.zip + + +# deploy-job: # This job runs in the deploy stage. +# stage: deploy # It only runs when *both* jobs in the test stage complete successfully. +# script: +# - echo "Deploying application..." +# - echo "Application successfully deployed."