Gerrit review tool wrapper updates
[ci-management.git] / shell / run_releasedockerhub.sh
1 #!/bin/bash
2
3 # SPDX-License-Identifier: EPL-1.0
4 ##############################################################################
5 # Copyright (c) 2019 The Linux Foundation and others.
6 #
7 # All rights reserved. This program and the accompanying materials
8 # are made available under the terms of the Eclipse Public License v1.0
9 # which accompanies this distribution, and is available at
10 # http://www.eclipse.org/legal/epl-v10.html
11 ##############################################################################
12
13 echo "---> run_releasedockerhub.sh"
14 # Ensure we fail the job if any steps fail
15 # Disable 'globbing'
16 set -euf -o pipefail
17
18 # shellcheck disable=SC1090
19 source ~/lf-env.sh
20
21 lf-activate-venv zipp==1.1.0 lftools
22
23 if [ ! -v RELEASEDOCKERHUB_ORG ]
24 then
25   echo "RELEASEDOCKERHUB_ORG is not defined. For onap set it to 'onap'"
26   exit 1
27 fi
28
29 cmd_str="--org $RELEASEDOCKERHUB_ORG"
30 if [ -v RELEASEDOCKERHUB_SUMMARY ]
31 then
32     cmd_str+=" --summary"
33 fi
34 if [ -v RELEASEDOCKERHUB_VERBOSE ]
35 then
36     cmd_str+=" --verbose"
37 fi
38 if [ -v RELEASEDOCKERHUB_REPO ]
39 then
40     cmd_str+=" --repo $RELEASEDOCKERHUB_REPO"
41 fi
42 if [ -v RELEASEDOCKERHUB_EXACT ]
43 then
44     cmd_str+=" --exact"
45 fi
46
47
48 if [ -v RELEASEDOCKERHUB_COPY ]
49 then
50     cmd_str+=" --copy"
51 fi
52
53 echo "cmd_str = >>$cmd_str<<"
54
55 # Run the releasedockerhub command in lftools
56 lftools nexus docker releasedockerhub  $cmd_str