summaryrefslogtreecommitdiff
path: root/contrib/imgts/entrypoint.sh
blob: 9c653eda042283b6fee9b164fb133891a3d3a2a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

set -e

source /usr/local/bin/lib_entrypoint.sh

req_env_var GCPJSON GCPNAME GCPPROJECT IMGNAMES BUILDID REPOREF

gcloud_init

ARGS="
    --update-labels=last-used=$(date +%s)
    --update-labels=build-id=$BUILDID
    --update-labels=repo-ref=$REPOREF
    --update-labels=project=$GCPPROJECT
"

for image in $IMGNAMES
do
    $GCLOUD compute images update "$image" $ARGS &
done

wait || echo "Warning: No \$IMGNAMES were specified."