From 7dee7bfeb0147a484f74b30e226a57a5015e63a6 Mon Sep 17 00:00:00 2001
From: henridb <henridb@stud.ntnu.no>
Date: Fri, 3 May 2024 10:37:27 +0200
Subject: [PATCH] fix: fix 32

---
 .gitlab-ci.yml   | 44 +++++++++++++++++++++++++
 Dockerfile       |  1 -
 OLDgitlab-ci.yml | 84 ------------------------------------------------
 src/App.vue      |  1 -
 4 files changed, 44 insertions(+), 86 deletions(-)
 delete mode 100644 OLDgitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2b71925..9007022 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,9 +10,53 @@ cache:
     - build/
 
 stages:
+  - install
+  - build
+  - test
+  - lint
   - docker_build_and_push
   - deploy_docker
 
+install_dependencies:
+  stage: install
+  script:
+    - npm ci
+
+build_project:
+  stage: build
+  script:
+    - npm ci
+    - npm run build
+  dependencies:
+    - install_dependencies
+
+vitest_unit-tests:
+  stage: test
+  cache:
+    key: ${CI_COMMIT_REF_SLUG}
+    paths:
+      - node_modules/
+    policy: pull
+  script:
+    - npm ci
+    - npm run test:unit
+  dependencies:
+    - install_dependencies
+
+eslint_run-lint:
+  stage: lint
+  cache:
+    key: ${CI_COMMIT_REF_SLUG}
+    paths:
+      - node_modules/
+    policy: pull
+  script:
+    - npm ci
+    - npm run lint
+  dependencies:
+    - install_dependencies
+  allow_failure: true
+
 docker_build_and_push:
   stage: docker_build_and_push
   image: docker:latest
diff --git a/Dockerfile b/Dockerfile
index a913a72..25e704e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,7 +4,6 @@ WORKDIR /app
 COPY package*.json ./
 RUN npm install
 COPY . .
-#ENV API_URL=http://backend:8080
 RUN npm run build
 
 # Step 2: Setup the server with Nginx
diff --git a/OLDgitlab-ci.yml b/OLDgitlab-ci.yml
deleted file mode 100644
index 8cc0079..0000000
--- a/OLDgitlab-ci.yml
+++ /dev/null
@@ -1,84 +0,0 @@
-image: node:alpine # Much smaller than other variants, faster and more resource effective
-
-variables:
-  DOCKER_TLS_CERTDIR: ""
-
-cache:
-  key: "${CI_COMMIT_REF_SLUG}" # Branch-specific cache keys to have separate caches across branches.
-  paths:
-    - node_modules/
-    - build/
-
-stages:
-  - install
-  - build
-  - test
-  - lint
-  - docker_build_and_push
-  - deploy_docker
-
-install_dependencies:
-  stage: install
-  script:
-    - npm ci
-
-build_project:
-  stage: build
-  script:
-    - npm ci
-    - npm run build
-  dependencies:
-    - install_dependencies
-
-vitest_unit-tests:
-  stage: test
-  cache:
-    key: ${CI_COMMIT_REF_SLUG}
-    paths:
-        - node_modules/
-    policy: pull
-  script:
-    - npm ci
-    - npm run test:unit
-  dependencies:
-    - install_dependencies
-
-eslint_run-lint:
-  stage: lint
-  cache:
-    key: ${CI_COMMIT_REF_SLUG}
-    paths:
-        - node_modules/
-    policy: pull
-  script:
-    - npm ci
-    - npm run lint
-  dependencies:
-    - install_dependencies
-  allow_failure: true  
-
-docker_build_and_push:
-  stage: docker_build_and_push
-  image: docker:latest
-  services:
-    - docker:dind
-  tags:
-    - dind
-  script:
-    - docker login -u $DOCKER_USER -p $DOCKER_PAT registry.gitlab.com
-    - docker build -t registry.gitlab.com/$DOCKER_USER/sparesti-registry:frontend .
-    - docker push registry.gitlab.com/$DOCKER_USER/sparesti-registry:frontend
-  when: manual
-
-deploy_docker:
-  stage: deploy_docker
-  image: ubuntu:latest
-  dependencies:
-    - docker_build_and_push
-  before_script:
-    - apt-get -yq update
-    - apt-get -yqq install ssh
-    - apt-get install sshpass
-  script:
-    - sshpass -p sParest1en ssh -v -o StrictHostKeyChecking=no root@128.199.53.153 "docker ps -q --filter 'name=^frontend$' | grep -q . && docker kill frontend && docker rm frontend && docker run -d --name frontend registry.gitlab.com/$DOCKER_USER/sparesti-registry:frontend"
-  when: manual
\ No newline at end of file
diff --git a/src/App.vue b/src/App.vue
index 19398b0..3e11f06 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,7 +1,6 @@
 <script setup lang="ts">
 import { RouterView } from 'vue-router'
 import ErrorBoundaryCatcher from '@/components/Exceptions/ErrorBoundaryCatcher.vue';
-console.log("TEST!");
 let apiUrl = import.meta.env.VITE_APP_API_URL;
 console.log("apiUrl: ", apiUrl);
 </script>
-- 
GitLab