-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
64 lines (57 loc) · 1.72 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
image: docker:stable
variables:
# When using dind service we need to instruct docker, to talk with the
# daemon started inside of the service. The daemon is available with
# a network connection instead of the default /var/run/docker.sock socket.
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services
#
# Note that if you're using Kubernetes executor, the variable should be set to
# tcp://localhost:2375 because of how Kubernetes executor connects services
# to the job container
DOCKER_HOST: tcp://0.0.0.0:2375
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
DOCKER_DRIVER: overlay2
# GITLAB_TOKEN: $CI_JOB_TOKEN
GITLAB_URL: $CI_SERVER_URL
services:
- docker:18.09-dind
stages:
- semantic
- build
- deploy
semantic:
stage: semantic
image: registry.crudus.no/docker/semantic-release-gitlab:latest
script:
- ls notes
- semantic-release -e @crudus/semantic-release-config
only:
- master
build_image:
stage: build
cache:
untracked: true
key: "$CI_BUILD_REF_NAME"
paths:
- node_modules/
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" -t "$CI_REGISTRY_IMAGE:latest" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- tags
deploy:
stage: deploy
image: bitnami/kubectl:latest
script:
- kubectl version --client
- kubectl set image deployment kaldheim-org kaldheim-org="$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" -n websites
environment:
name: kaldheim-org
url: https://kaldheim.org
only:
- tags