Skip to content
Snippets Groups Projects
Commit 2b070a7e authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

deploy config

parent edf7d6ca
No related branches found
No related tags found
1 merge request!7update master to dev
stages:
- Build
# - Test
- Docker build
- Deploy
#services:
# - mongo
variables:
CONTAINER_IMAGE: 'registry.kszk.bme.hu/bodysch/frontend:$CI_COMMIT_REF_NAME'
# MONGODB_TEST_URI: 'mongodb://mongo/bodysch-test'
Build:
stage: Build
tags: [kszk]
image: node:14
script:
- npm install
- npm run build
cache:
paths:
- node_modules/
- build/
artifacts:
expire_in: 1 day
paths:
- node_modules/
- build/
#Test:
# stage: Test
# tags: [kszk]
# image: node:14
# script:
# - npm test
# artifacts:
# expire_in: 1 week
# paths:
# - junit.xml
# reports:
# junit: junit.xml
Docker build:
stage: Docker build
tags: [kszk]
only:
- master
- dev
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: ['']
script:
- echo "{\"auths\":{\"registry.kszk.bme.hu\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CONTAINER_IMAGE
Deploy dev:
stage: Deploy
tags: [kszk-deploy] # request the custom SSH executor
only:
- dev
script: # your deploy logic
- echo "$REGISTRY_PASSWORD" | docker login registry.kszk.bme.hu --username $REGISTRY_USER --password-stdin
- cp docker-compose.dev.yml /home/kszk-gitlab-deployer/bodysch-dev/
- cd /home/kszk-gitlab-deployer/bodysch-dev/
- docker-compose -f docker-compose.dev.yml --no-ansi pull
- docker-compose -f docker-compose.dev.yml up -d
- docker system prune -f
variables:
SSH_HOST: donald.sch.bme.hu # required
SSH_USER: kszk-gitlab-deployer # default: kszk-gitlab-deployer
SSH_PORT: 10122 # default: 22
# Deploy prod:
# stage: Deploy
# tags: [kszk-deploy] # request the custom SSH executor
# only:
# - master
# script: # your deploy logic
# - echo "$REGISTRY_PASSWORD" | docker login registry.kszk.bme.hu --username $REGISTRY_USER --password-stdin
# - cp docker-compose.yml /home/kszk-gitlab-deployer/kszkepzes-prod/
# - cd /home/kszk-gitlab-deployer/kszkepzes-prod/
# - docker-compose --no-ansi pull
# - docker-compose up -d
# - docker system prune -f
# variables:
# SSH_HOST: donald.sch.bme.hu # required
# SSH_USER: kszk-gitlab-deployer # default: kszk-gitlab-deployer
# SSH_PORT: 10122 # default: 22
...@@ -65,3 +65,7 @@ serviceWorker.* ...@@ -65,3 +65,7 @@ serviceWorker.*
setupTests.* setupTests.*
tools/* tools/*
.gitlab-ci.yml
nginx.conf
# auto detects a good number of processes to run
worker_processes auto;
#Provides the configuration file context in which the directives that affect connection processing are specified.
events {
# Sets the maximum number of simultaneous connections that can be opened by a worker process.
worker_connections 8000;
# Tells the worker to accept multiple connections at a time
multi_accept on;
}
http {
# what times to include
include /etc/nginx/mime.types;
# what is the default one
default_type application/octet-stream;
# Sets the path, format, and configuration for a buffered log write
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $upstream_addr '
'"$http_referer" "$http_user_agent"';
server {
# listen on port 80
listen 3040;
# save logs here
access_log /var/log/nginx/access.log compression;
# where the root here
root /var/www;
# what file to server as index
index index.html index.htm;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to redirecting to index.html
try_files $uri $uri/ /index.html;
}
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
# Javascript and CSS files
location ~* \.(?:css|js)$ {
try_files $uri =404;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
# Any route containing a file extension (e.g. /devicesfile.js)
location ~ ^.+\..+$ {
try_files $uri =404;
}
}
}
# PORT
:8080
# Reverse proxy
# rewrite
# auth-service
route /api/* {
#uri strip_prefix /api
reverse_proxy * 127.0.0.1:8000
}
reverse_proxy * 127.0.0.1:3000
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment