summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorBengt Thuree <bthuree@linuxfoundation.org>2020-01-07 05:41:54 +0000
committerGerrit Code Review <gerrit@onap.org>2020-01-07 05:41:54 +0000
commitc6b11dc42240cd9ce760a07465721a90e7856368 (patch)
tree58e4382705a009ca13069e272b0d238bcaea9f46 /shell
parent73df7002cc010fbc827f646db085aafe06133b54 (diff)
parent8957be512fa94e58f4e1942726025f5daa979c90 (diff)
Merge "Add releasedockerhub command to cron"
Diffstat (limited to 'shell')
-rw-r--r--shell/run_releasedockerhub.sh56
1 files changed, 56 insertions, 0 deletions
diff --git a/shell/run_releasedockerhub.sh b/shell/run_releasedockerhub.sh
new file mode 100644
index 000000000..42771af6e
--- /dev/null
+++ b/shell/run_releasedockerhub.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2019 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+
+echo "---> run_releasedockerhub.sh"
+# Ensure we fail the job if any steps fail
+# Disable 'globbing'
+set -euf -o pipefail
+
+# shellcheck disable=SC1090
+source ~/lf-env.sh
+
+lf-activate-venv lftools
+
+if [ ! -v RELEASEDOCKERHUB_ORG ]
+then
+ echo "RELEASEDOCKERHUB_ORG is not defined. For onap set it to 'onap'"
+ exit 1
+fi
+
+cmd_str="--org $RELEASEDOCKERHUB_ORG"
+if [ -v RELEASEDOCKERHUB_SUMMARY ]
+then
+ cmd_str+=" --summary"
+fi
+if [ -v RELEASEDOCKERHUB_VERBOSE ]
+then
+ cmd_str+=" --verbose"
+fi
+if [ -v RELEASEDOCKERHUB_REPO ]
+then
+ cmd_str+=" --repo $RELEASEDOCKERHUB_REPO"
+fi
+if [ -v RELEASEDOCKERHUB_EXACT ]
+then
+ cmd_str+=" --exact"
+fi
+
+
+if [ -v RELEASEDOCKERHUB_COPY ]
+then
+ cmd_str+=" --copy"
+fi
+
+echo "cmd_str = >>$cmd_str<<"
+
+# Run the releasedockerhub command in lftools
+lftools nexus docker releasedockerhub $cmd_str