-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
47 lines (41 loc) · 1.12 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
stages:
# - build
- docker
- kubernetes
variables:
IMAGE: snake
GOOGLE_APPLICATION_CREDENTIALS: /cred.json
CLOUDSDK_CONFIG: /config/mygcloud
DOCKER_DRIVER: overlay
DOCKER_HOST: tcp://docker:2375
#Build:
# stage: build
# image: node:jessie
# script:
# - rm -rf node_modules package-lock.json
# - npm install
# - npm run build-ts
# only:
# - master
# artifacts:
# expire_in: 1 day
# paths:
# - dist
Docker:
stage: docker
image: docker
services:
- docker:dind
script:
- docker build -t $CI_REGISTRY/$IMAGE:$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID-$CI_COMMIT_REF_NAME ./
- docker login -u _json_key -p "$SERVICE_ACCOUNT_JSON" https://eu.gcr.io
- docker push $CI_REGISTRY/$IMAGE:$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID-$CI_COMMIT_REF_NAME
Kubernetes:
stage: kubernetes
image:
name: lachlanevenson/k8s-kubectl
entrypoint: [""]
script:
- mkdir ~/.kube
- echo "${KUBE_CONFIG}" > ~/.kube/config
- kubectl set image deployment/snake snake=$CI_REGISTRY/$IMAGE:$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID-$CI_COMMIT_REF_NAME