-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
39 lines (35 loc) · 1.13 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
default:
tags:
- service
stages:
- check
- build
- deploy
check-job:
stage: check
script:
- docker info
build-job:
stage: build
script:
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE
deploy-job:
stage: deploy
script:
- docker rm -f $CI_PROJECT_PATH_SLUG
- >
docker run -d
--name $CI_PROJECT_PATH_SLUG
--restart always
--label traefik.enable=true
--label traefik.http.routers.$CI_PROJECT_PATH_SLUG.entrypoints=https
--label traefik.http.routers.$CI_PROJECT_PATH_SLUG.rule='Host(`luna.codes`)'
--label traefik.http.routers.$CI_PROJECT_PATH_SLUG.tls=true
--label traefik.http.routers.$CI_PROJECT_PATH_SLUG.tls.certresolver=cloudflare
--label traefik.http.routers.$CI_PROJECT_PATH_SLUG.service=$CI_PROJECT_PATH_SLUG
--label traefik.http.routers.$CI_PROJECT_PATH_SLUG.middlewares=all-cors-headers@file,error-handler@file
--label traefik.http.services.$CI_PROJECT_PATH_SLUG.loadbalancer.server.port=80
--network proxy
$CI_REGISTRY_IMAGE:latest