diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-05-18 10:50:56 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-05-31 08:57:24 +0000 |
commit | 74f5502be15e3a88dcc6460651817ef6a31e05c4 (patch) | |
tree | a62c2c45d8f4654ea8cc1a76a20fba5adc05d6c8 | |
parent | 7200f9693aeed80dba4ba78e072459fd6e50f0f3 (diff) |
TestRelease.job: Add support for wildcards in --tarball option
... and remove support for file:// protocol as well as other useless stuff.
Change-Id: I1091870add7708ba4d1b9a21c120ba82fbeaac4e
-rwxr-xr-x | TestRelease.job | 44 |
1 files changed, 9 insertions, 35 deletions
diff --git a/TestRelease.job b/TestRelease.job index dec54924..d6325590 100755 --- a/TestRelease.job +++ b/TestRelease.job @@ -1,37 +1,19 @@ #!/bin/bash -# Set defaults -if test x"${debug}" = x"true"; then - export CONFIG_SHELL="/bin/bash -x" -else - export CONFIG_SHELL="/bin/bash" -fi - user_workspace="$PWD" tcwg_regression_rev=master OPTS="`getopt -o w:t:h -l tarball:,workspace:,help,tcwg-regression-rev:`" while test $# -gt 0; do - echo 1 = "$1" case $1 in -w|--workspace) user_workspace=$2; shift ;; - -t|--tarball) tarball=$2; shift ;; - -h|--help) usage ;; + -t|--tarball) tarball_url=$2; shift ;; --tcwg-regression-rev) tcwg_regression_rev=$2; shift ;; --) break ;; esac shift done -if test -e ${user_workspace}; then - cat << EOF > ${user_workspace}/BUILD-INFO.txt -Format-Version: 0.5 - -Files-Pattern: * -License-Type: open -EOF -fi - testdir=${user_workspace}/_test # Create a test directory @@ -39,24 +21,16 @@ if test ! -d ${testdir}; then mkdir -p ${testdir} fi -# Use the newly created build directory -cd ${testdir} +. jenkins-helper.sh + +url_basename=$(basename "$tarball_url") +rm -f $url_basename +wget_wildcard_url "$tarball_url" +file="$(ls $url_basename)" +mv $file $testdir/ +file="$(basename "$file")" -file=`basename ${tarball}` tarball_name="${testdir}/${file}" -protocol="`echo ${tarball} | cut -d ':' -f 1`" -if test x${protocol} = x"file"; then - tarball_name="`echo ${tarball} | sed -e 's:file./::'`" -else - # Download the toolchain binary tarball - if test ! -e ${testdir}/${file}; then - wget ${tarball} --directory=${testdir} --progress=dot:giga - if test $? -gt 0; then - echo "ERROR: ${tarball} doesn't exist on remote machine!" - exit 1 - fi - fi -fi # Extract the tarball dir="`echo ${file} | sed -e 's:.tar.xz::'`" |