-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
31 lines (31 loc) · 1.27 KB
/
cloudbuild.yaml
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
steps:
- name: 'gcr.io/cloud-builders/git'
entrypoint: '/bin/sh'
args:
- '-c'
- |
# Get the gpmf git submodule
SUBMODULE_URL=$(git config -f .gitmodules --get-regexp '^submodule\..*\.url$' | awk '{ print $2 }')
SUBMODULE_DIR=$(git config -f .gitmodules --get-regexp '^submodule\..*\.path$' | awk '{ print $2 }')
git clone $$SUBMODULE_URL $$SUBMODULE_DIR
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |-
echo "$(gcloud secrets versions access latest --secret=GITHUB_TOKEN --format='get(payload.data)' | tr '_-' '/+' | base64 -d)" > github_token.txt
- name: gcr.io/cloud-builders/docker
entrypoint: 'bash'
env:
- '_GITHUB_TOKEN=$(cat github_token.txt)'
- '_CONSOLE_IMAGE=gcr.io/$PROJECT_ID/skiconsole:v$TAG_NAME'
- '_WEBAPI_IMAGE=gcr.io/$PROJECT_ID/skiwebapi:v$TAG_NAME'
- '_VERSION=$TAG_NAME'
args:
- '-c'
- |-
_GITHUB_TOKEN=$(cat github_token.txt)
docker build -t $$_CONSOLE_IMAGE --build-arg VERSION=$$_VERSION --build-arg GITHUB_TOKEN=$$_GITHUB_TOKEN -f ./SlalomTracker.Console/Dockerfile .
docker build -t $$_WEBAPI_IMAGE --build-arg VERSION=$$_VERSION --build-arg GITHUB_TOKEN=$$_GITHUB_TOKEN -f ./SlalomTracker.WebApi/Dockerfile .
docker push $$_CONSOLE_IMAGE
docker push $$_WEBAPI_IMAGE