fixed publish script not to fail when there are no packages

This commit is contained in:
Roman Alekseenkov 2012-10-10 14:43:36 -07:00
parent d056f93073
commit 3952fdb4a8
1 changed files with 13 additions and 5 deletions

View File

@ -1,22 +1,30 @@
#!/bin/bash
set -e
if [ ! $# == 1 ]; then
echo "Usage: $0 <fuel-package-name.tar.gz>"
echo "Available archives for publishing:"
for line in `ls fuel-*.tar.gz`; do echo " * $line (run \"$0 $line\")"; done
lines=`ls fuel-*.tar.gz 2> /dev/null`
if [[ ! $lines ]]; then
echo "No archives available for publishing"
else
echo "Available archives for publishing:"
for line in $lines; do echo " * $line (run \"$0 $line\")"; done
fi
exit
fi
package_file="$1"
if [ ! -f $package_file ];
then
if [ ! -f $package_file ]; then
echo "File $package_file not found!"
exit
fi
#
# publish package to http://download.mirantis.com/fuel-releases/
#
rsync -v $package_file rsync://repo.srt.mirantis.net:/repo/fuel-releases/$package_file