Skip to content
Snippets Groups Projects
Commit 7dee7bfe authored by Henrik's avatar Henrik
Browse files

fix: fix 32

parent 278e85fc
No related branches found
No related tags found
1 merge request!91Feat/deployment
Pipeline #284070 passed with warnings
......@@ -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
......
......@@ -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
......
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
<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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment