-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
47 lines (39 loc) · 1.26 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
include:
- project: 'infrastructure/templates'
file:
- docker.yml
stages:
- docker
- deploy
application:
extends: .common_image
only:
- /^devops\//
- master
variables:
DOCKERFILE: |
FROM golang:1.17-alpine
ADD ./ /app/
RUN cd /app/ \
&& go build -v -o /app/app ./cmd/app
FROM alpine
COPY --from=0 /app/app /bin/
CMD app
production:
stage: deploy
image: ruvents/helm
environment:
name: production
url: https://telegram.ruvents.dev/
before_script:
- chmod 0600 "${KUBECONFIG}"
script:
- helm upgrade --install --atomic --cleanup-on-fail --create-namespace --namespace "${CI_PROJECT_PATH_SLUG}" --timeout 1m --values .devops/values.yaml app .devops
--set Application.Environment="${CI_ENVIRONMENT_NAME}"
--set Application.RegistryImage="${CI_REGISTRY_IMAGE}"
--set Application.RegistryImageTag="${CI_COMMIT_TAG:-build-$CI_COMMIT_SHORT_SHA}"
--set Application.BaseHost="${HOSTNAME}"
--set Services.SentryDSN="${SENTRY_DSN}"
--set Secrets.GitLabToken="${GITLAB_TOKEN}"
--set Secrets.DockerRegistries[0].Username="${DOCKER_REGISTRY_USERNAME}"
--set Secrets.DockerRegistries[0].Password="${DOCKER_REGISTRY_PASSWORD}"