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

fix: fix 2

parent b2eadf5e
No related branches found
No related tags found
1 merge request!91Feat/deployment
Pipeline #283707 passed with warnings
...@@ -10,53 +10,9 @@ cache: ...@@ -10,53 +10,9 @@ cache:
- build/ - build/
stages: stages:
- install
- build
- test
- lint
- docker_build_and_push - docker_build_and_push
- deploy_docker - 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: docker_build_and_push:
stage: docker_build_and_push stage: docker_build_and_push
image: docker:latest image: docker:latest
...@@ -80,5 +36,5 @@ deploy_docker: ...@@ -80,5 +36,5 @@ deploy_docker:
- apt-get -yqq install ssh - apt-get -yqq install ssh
- apt-get install sshpass - apt-get install sshpass
script: 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" - sshpass -p sParest1en ssh -v -o StrictHostKeyChecking=no root@128.199.53.153 "docker kill frontend && docker rm frontend; docker run -d --name frontend registry.gitlab.com/$DOCKER_USER/sparesti-registry:frontend"
when: manual when: manual
\ No newline at end of file
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment