From 6db560f43499506bf938bdc2e66dbfaf1d807cf3 Mon Sep 17 00:00:00 2001
From: Matthias Konitzny <konitzny@ibr.cs.tu-bs.de>
Date: Tue, 16 Nov 2021 17:22:57 +0000
Subject: [PATCH] Gitlab ci now supports automatic builds.

---
 .gitlab-ci.yml | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4f7b21e..eee948c 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."
-- 
GitLab