-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.yaml
66 lines (57 loc) · 1.77 KB
/
build.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
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
65
66
steps:
# add source info
- name: 'gcr.io/cloud-builders/gcloud'
args: [
'debug',
'source',
'gen-repo-info-file',
'--output-directory', 'files']
# install npm deps
- name: 'gcr.io/cloud-builders/npm'
args: ['install', '--prefix', 'ui']
# build ui
- name: 'gcr.io/cloud-builders/npm'
args: ['run-script', 'build', '--prefix', 'ui']
# build frontend image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--no-cache', '--rm=true',
'-t', '${_REGISTRY_}/${_IMAGE_}-frontend:${SHORT_SHA}',
'-t', '${_REGISTRY_}/${_IMAGE_}-frontend:latest',
'-f', 'Dockerfile.frontend', '.']
# push frontend image
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'eu.gcr.io/playnet-gce/devhub-frontend']
# build backend image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--no-cache', '--rm=true',
'-t', '${_REGISTRY_}/${_IMAGE_}-backend:${SHORT_SHA}',
'-t', '${_REGISTRY_}/${_IMAGE_}-backend:latest',
'--build-arg', 'VERSION=$(VERSION)',
'--build-arg', 'GIT_HOST=${_GIT_HOST_}',
'--build-arg', 'REPO=${_REPO_}',
'--build-arg', 'NAME=${_NAME_}',
'--build-arg', 'COMMAND="buildgo"',
'-f', 'Dockerfile.backend', '.']
# push backend image
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'eu.gcr.io/playnet-gce/devhub-backend']
# update deployment
- name: 'gcr.io/cloud-builders/kubectl'
args:
- delete
- pod
- -n
- devhub-dev
- -l
- app=devhub
env:
- 'CLOUDSDK_COMPUTE_ZONE=europe-west1-d'
- 'CLOUDSDK_CONTAINER_CLUSTER=cluster-1'
images: ['eu.gcr.io/playnet-gce/devhub-frontend', 'eu.gcr.io/playnet-gce/devhub-backend']
# defs
substitutions:
_NAME_: devhub
_GIT_HOST_: github.com
_REPO_: playnet-public
_REGISTRY_: eu.gcr.io
_IMAGE_: playnet-gce/devhub