Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[dist] Create file if it doesn't exist
- Prevents the script from exit if the file that contains the last
build checked doesn't exist. This happens with the addition of a
new version.
- Use a variable to refer to the last.obs_version file.
  • Loading branch information
eduardoj committed Jan 26, 2018
1 parent 1d3eb03 commit ff7655c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dist/schedule-obs.sh
Expand Up @@ -7,10 +7,11 @@ function trigger_run {
OBS_VERSION="$1"
FULL_URL="http://download.opensuse.org/repositories/OBS:/$2/"
filename=`curl -s $FULL_URL | grep "obs-server.x86_64-.*qcow2" | head -n1 | sed -e 's,.*href=",,; s,".*,,; s,\.mirrorlist,,'`
ofilename=`cat /tmp/.last.obs_$OBS_VERSION`
last_obs_filename="/tmp/.last.obs_$OBS_VERSION"
ofilename=`cat $last_obs_filename || touch $last_obs_filename`
if test "x$ofilename" != "x$filename"; then
/usr/share/openqa/script/client isos post --host https://openqa.opensuse.org HDD_1_URL=$FULL_URL$filename DISTRI=obs ARCH=x86_64 VERSION=$OBS_VERSION BUILD=`echo $filename | sed -e 's,obs-server.x86_64-,,; s,Build,,; s,\.qcow2,,'` FLAVOR=Appliance > /dev/null
echo $filename > /tmp/.last.obs_$OBS_VERSION
echo $filename > $last_obs_filename
fi
}

Expand Down

0 comments on commit ff7655c

Please sign in to comment.