From: Alexandru Avadanii Date: Wed, 22 Apr 2020 13:56:31 +0000 (+0200) Subject: validation: iec: Pull docker images before run X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=0da1e36c7ac57c3a13180e3a6c437bda6ad3dca4;p=ci-management.git validation: iec: Pull docker images before run Add a new 'PULL' job paramater for validation--* jobs, as well as 'bluval-*' jobs; set it to 'false' by default and 'true' for IEC validation jobs since most IEC jobs run on static Jenkins slaves where the validation docker images might already be present from previous runs. JIRA: VAL-107 Depends-on: Id4b7947a0de7abf07f69812c6deef71919b9041a Change-Id: Ic2f690d6627f6ae284a27727f3c98fe03960cbda Signed-off-by: Alexandru Avadanii --- diff --git a/jjb/akraino-templates/akraino-iec-templates.yaml b/jjb/akraino-templates/akraino-iec-templates.yaml index 09e5721..640923f 100644 --- a/jjb/akraino-templates/akraino-iec-templates.yaml +++ b/jjb/akraino-templates/akraino-iec-templates.yaml @@ -59,6 +59,7 @@ BLUEPRINT={project-name} VERSION=master OPTIONAL=false + PULL=yes block: true - project: !j2: | diff --git a/jjb/akraino-templates/akraino-validation-macros.yaml b/jjb/akraino-templates/akraino-validation-macros.yaml index 6bdcdce..193657f 100644 --- a/jjb/akraino-templates/akraino-validation-macros.yaml +++ b/jjb/akraino-templates/akraino-validation-macros.yaml @@ -50,6 +50,10 @@ name: OPTIONAL default: '' description: 'If set to yes run optional tests' + - string: + name: PULL + default: 'false' + description: 'If set to yes pull docker images before run' ############ # SETTINGS # diff --git a/jjb/shell/run_bluval.sh b/jjb/shell/run_bluval.sh index fbe9aed..d850f79 100755 --- a/jjb/shell/run_bluval.sh +++ b/jjb/shell/run_bluval.sh @@ -15,6 +15,7 @@ export PATH=$PATH:/home/jenkins/.local/bin cwd=$(pwd) current_user=$(whoami) is_optional="false" +pull="false" info () { logger -s -t "run_blu_val.info" "$*" @@ -66,7 +67,7 @@ error () { } # Get options from shell -while getopts "j:k:u:s:b:l:r:n:ov:" optchar; do +while getopts "j:k:u:s:b:l:r:n:opv:" optchar; do case "${optchar}" in j) cluster_master_ip=${OPTARG} ;; k) k8s_config_dir=${OPTARG} ;; @@ -76,6 +77,7 @@ while getopts "j:k:u:s:b:l:r:n:ov:" optchar; do n) blueprint_name=${OPTARG} ;; u) sh_user=${OPTARG} ;; o) is_optional="true" ;; + p) pull="true" ;; v) version=${OPTARG} ;; *) echo "Non-option argument: '-${OPTARG}'" >&2 usage @@ -162,6 +164,10 @@ if [ "$is_optional" == "true" ] || [ "$OPTIONAL" == "yes" ] then options+=" -o" fi +if [ "$pull" == "true" ] || [ "$PULL" == "yes" ] +then + options+=" -p" +fi set +e if python3 --version > /dev/null; then