summaryrefslogtreecommitdiff
path: root/contrib/imgts
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2019-08-01 07:31:04 -0400
committerChris Evich <cevich@redhat.com>2019-08-28 11:54:06 -0400
commit370b1a887cbf6db8ac893c39118cf8c6c2fd663c (patch)
tree33fb752adc3957916890103fcc8ff68a57b8a1a5 /contrib/imgts
parent8e46106f420dfc6125750c12e13c5ae39be9d6f1 (diff)
downloadpodman-370b1a887cbf6db8ac893c39118cf8c6c2fd663c.tar.gz
podman-370b1a887cbf6db8ac893c39118cf8c6c2fd663c.tar.bz2
podman-370b1a887cbf6db8ac893c39118cf8c6c2fd663c.zip
Cirrus: Reimplement release archive + upload
The initial implementation was far more complicated than necessary. Strip out the complexities in favor of a simpler and more direct approach. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/imgts')
-rw-r--r--contrib/imgts/lib_entrypoint.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/imgts/lib_entrypoint.sh b/contrib/imgts/lib_entrypoint.sh
index 7b76c823f..3f6b11128 100644
--- a/contrib/imgts/lib_entrypoint.sh
+++ b/contrib/imgts/lib_entrypoint.sh
@@ -35,10 +35,15 @@ req_env_var() {
gcloud_init() {
set +xe
- TMPF=$(mktemp -p '' .$(uuidgen)XXXX)
- trap "rm -f $TMPF" EXIT
- echo "$GCPJSON" > $TMPF && \
- $GCLOUD auth activate-service-account --project "$GCPPROJECT" --key-file=$TMPF || \
+ if [[ -n "$1" ]] && [[ -r "$1" ]]
+ then
+ TMPF="$1"
+ else
+ TMPF=$(mktemp -p '' .$(uuidgen)_XXXX.json)
+ trap "rm -f $TMPF &> /dev/null" EXIT
+ echo "$GCPJSON" > $TMPF
+ fi
+ $GCLOUD auth activate-service-account --project="$GCPPROJECT" --key-file="$TMPF" || \
die 5 FATAL auth
- rm -f $TMPF
+ rm -f $TMPF &> /dev/null || true # ignore any read-only error
}