-
Notifications
You must be signed in to change notification settings - Fork 22
/
.gitlab-ci.yml
30 lines (27 loc) · 1.19 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
image: docker:git
services:
- docker:dind
build:
stage: build
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker pull registry.gitlab.com/tdickman/southwest-alerts:latest
- docker build --cache-from registry.gitlab.com/tdickman/southwest-alerts:latest -t registry.gitlab.com/tdickman/southwest-alerts:build$CI_PIPELINE_ID -t registry.gitlab.com/tdickman/southwest-alerts:latest .
- docker push registry.gitlab.com/tdickman/southwest-alerts:build$CI_PIPELINE_ID
- docker push registry.gitlab.com/tdickman/southwest-alerts:latest
only:
- master
k8s-trigger:
image: google/cloud-sdk
stage: deploy
script:
- echo "$GOOGLE_KEY" > key.json
- gcloud auth activate-service-account --key-file key.json
- gcloud config set compute/zone us-central1-a
- gcloud config set project hello-world-392
- gcloud config set container/use_client_certificate True
- gcloud container clusters get-credentials main
- sed "s/BUILD_NUMBER/${CI_PIPELINE_ID}/g" deployment.yaml | kubectl delete --ignore-not-found -f -
- sed "s/BUILD_NUMBER/${CI_PIPELINE_ID}/g" deployment.yaml | kubectl create -f -
only:
- master