-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
41 lines (37 loc) · 969 Bytes
/
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
steps:
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
# File that contains failures.
failure_file=failure.log
touch ${failure_file}
for d in src/cmd/*/; do
config="${d}cloudbuild.yaml"
if [[ ! -f "${config}" ]]; then
continue
fi
echo "Building $d ... "
(
logfile="${d::-1}.log"
gcloud builds submit --config=${config} --project=${PROJECT_ID} --substitutions=_OUTPUT_PROJECT=${_OUTPUT_PROJECT},TAG_NAME=${COMMIT_SHA} > ${logfile} 2>&1
if [[ $? -ne 0 ]]; then
echo "$d failed" | tee -a ${failure_file}
cat ${logfile}
else
echo "$d finished"
fi
) &
done
wait
# Check if there is any failure.
if [[ -s ${failure_file} ]]; then
echo
echo "Some builds failed:"
cat ${failure_file}
echo "Exiting."
exit 1
fi
echo "All builds succeeded."
timeout: 7200s