-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
50 lines (36 loc) · 1.11 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
image: docker:latest
services:
- docker:dind
stages:
- build
- deploy
before_script:
- apk --update add git
- git submodule update --init
variables:
DOCKER_DRIVER: overlay2
build:
stage: build
only:
- master
script:
- docker build --build-arg NPM_TOKEN="$NPM_TOKEN" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA" .
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
artifacts:
paths:
- node_modules
expire_in: 60 min
deploy-master:
stage: deploy
image: mateothegreat/docker-alpine-gcloud-kubectl
only:
- master
script:
- kubectl config set-cluster kube-cluster --server="$K8_API_URL" --insecure-skip-tls-verify=true
- kubectl config set-credentials gitlab --token="$K8_TOKEN"
- kubectl config set-context default-context --cluster=kube-cluster --user=gitlab
- kubectl config use-context default-context
- apk --update add git
- git submodule update --init
- make install