-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
68 lines (65 loc) · 1.64 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
variables:
IMG_NAME: "registry.gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}"
IMG_TAG: "${CI_COMMIT_REF_SLUG}"
IMG: "${IMG_NAME}:${IMG_TAG}"
build:
image: docker:18.09
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
services:
- name: docker:20-dind
alias: docker
command: [ "--tls=false" ]
stage: build
script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker build -t $IMG -f ./Dockerfile .
- docker push $IMG
only:
- main
- next
tags:
- build
deploy:
image: alpine/helm:3.2.1
stage: deploy
script:
- helm upgrade --install
"${CI_PROJECT_NAME}.production"
--namespace bulutly-web
--set name="web-prod"
--set domainName="bulutly.net"
--set image.repository="${IMG_NAME}"
--set image.tag="${IMG_TAG}"
--set tls.enabled="true"
--set tls.secretName="prod-bulutly-net-tls"
--create-namespace
.ci/chart
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://bulutly.net
only:
- main
needs: ["build"]
deploy_next:
image: alpine/helm:3.2.1
stage: deploy
script:
- helm upgrade --install
"${CI_PROJECT_NAME}.next"
--namespace bulutly-web
--set name="web-next"
--set domainName="next.bulutly.net"
--set image.repository="${IMG_NAME}"
--set image.tag="${IMG_TAG}"
--set tls.enabled="true"
--set tls.secretName="next-bulutly-net-tls"
--create-namespace
.ci/chart
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://next.bulutly.net
only:
- next
needs: ["build"]