-
Notifications
You must be signed in to change notification settings - Fork 4
/
cloudbuild.yaml
76 lines (66 loc) · 2.39 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Timeout for complete build. Default is 10m.
timeout: 10800s
options:
env:
- 'PROJECT=$PROJECT_ID'
- 'IMAGES_VERSION=$_IMAGES_VERSION'
- 'ARTIFACTS=/workspace/output'
availableSecrets:
secretManager:
- versionName: projects/${PROJECT_NUMBER}/secrets/platform-ssh-host-ca-private-key/versions/latest
env: SSH_HOST_CA_KEY
############################################################################
# BUILD ARTIFACTS
############################################################################
steps:
# stage1 minimal kernel & initram using stock ubuntu kernel.
- name: gcr.io/$PROJECT_ID/epoxy-images:1.0
args: [
'/workspace/builder.sh', 'stage1_minimal'
]
# stage3_ubuntu images.
- name: gcr.io/$PROJECT_ID/epoxy-images:1.0
entrypoint: /bin/bash
args:
- '-c'
- '/workspace/builder.sh stage3_ubuntu'
secretEnv:
- SSH_HOST_CA_KEY
# stage3_update images.
- name: gcr.io/$PROJECT_ID/epoxy-images:1.0
args: [
'/workspace/builder.sh', 'stage3_update'
]
############################################################################
# DEPLOY VERSIONED ARTIFACTS
#
# Note: the artifacts built above need to be copied to specific locations in
# the target bucket. Currently, the cloudbuilder 'artifacts' directive does
# not support multiple target locations. So, the steps below are explicit.
############################################################################
# stage3_ubuntu.
- name: gcr.io/cloud-builders/gsutil
args: [
'-h', 'Cache-Control:private, max-age=0, no-transform', '-m',
'cp', '-r',
'/workspace/output/stage1_kernel.vmlinuz',
'/workspace/output/stage1_initramfs.cpio.gz',
'/workspace/output/stage3_kernel_ubuntu.vmlinuz',
'/workspace/output/stage3_initramfs_ubuntu.cpio.gz',
'/workspace/actions/stage2/stage1to2.ipxe',
'/workspace/actions/stage3_ubuntu/*.json',
'gs://epoxy-$PROJECT_ID/$_IMAGES_VERSION/stage3_ubuntu/'
]
# stage3_update.
- name: gcr.io/cloud-builders/gsutil
args: [
'-h', 'Cache-Control:private, max-age=0, no-transform', '-m',
'cp', '-r',
'/workspace/output/stage1_kernel.vmlinuz',
'/workspace/output/stage1_initramfs.cpio.gz',
'/workspace/output/stage3_kernel_update.vmlinuz',
'/workspace/output/stage3_initramfs_update.cpio.gz',
'/workspace/actions/stage2/stage1to2.ipxe',
'/workspace/actions/stage3_update/*.json',
'gs://epoxy-$PROJECT_ID/$_IMAGES_VERSION/stage3_update/'
]