-
Notifications
You must be signed in to change notification settings - Fork 79
/
cloudbuild.yaml
59 lines (58 loc) · 1.99 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
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
steps:
- name: gcr.io/cloud-builders/gcloud
entrypoint: 'bash'
args: ['/workspace/buildscripts/copybins.sh','${_DIST_BUCKET}','master']
- name: gcr.io/kaniko-project/executor:latest
args:
- --destination=gcr.io/$PROJECT_ID/hybrics-bin:$BRANCH_NAME
- --cache=false
- --target=builder
- --cache-ttl=10h
- --dockerfile=Dockerfile
env:
- 'VERSION=${BRANCH_NAME}'
- 'PKG_VERSION=0.0.1'
- name: gcr.io/kaniko-project/executor:latest
args:
- --destination=gcr.io/$PROJECT_ID/hybrics:$BRANCH_NAME
- --cache=false
- --cache-ttl=10h
- --dockerfile=Dockerfile
env:
- 'VERSION=${BRANCH_NAME}'
- 'PKG_VERSION=0.0.1'
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker login --username=$$USERNAME --password=$$PASSWORD']
secretEnv: ['USERNAME', 'PASSWORD']
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker pull gcr.io/$PROJECT_ID/hybrics:$BRANCH_NAME']
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker tag gcr.io/$PROJECT_ID/hybrics:$BRANCH_NAME $$USERNAME/sdfs:$BRANCH_NAME']
secretEnv: ['USERNAME']
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker push $$USERNAME/sdfs:$BRANCH_NAME']
secretEnv: ['USERNAME']
- name: gcr.io/cloud-builders/gcloud
entrypoint: 'bash'
args: [ '-c', "mkdir pkgs/" ]
- name: gcr.io/cloud-builders/docker
entrypoint: 'bash'
args: [ '-c', 'docker run --rm gcr.io/hybrics/hybrics-bin:$BRANCH_NAME | tar --extract --verbose -C pkgs/']
- name: gcr.io/cloud-builders/gcloud
entrypoint: 'bash'
args: [ '-c', "gsutil cp pkgs/*.* gs://${_DIST_BUCKET}/pkgs/" ]
substitutions:
_DIST_BUCKET: abucket # default value
timeout: 10800s
options:
machineType: 'N1_HIGHCPU_32'
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_NUMBER/secrets/docker-password/versions/1
env: 'PASSWORD'
- versionName: projects/$PROJECT_NUMBER/secrets/docker-username/versions/1
env: 'USERNAME'