blob: 83ecb8694bb61d91647dad64aeef9a05a1e55d02 [file] [log] [blame]
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} --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}
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: 3600s