2016-09-07 23:11:08 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-01-06 19:49:56 +01:00
|
|
|
# sf_upload <FILES> <sf_dir>
|
2016-09-07 23:11:08 +02:00
|
|
|
sf_upload()
|
|
|
|
{
|
2019-01-06 19:49:56 +01:00
|
|
|
echo "Uploading following files: ${1}
|
|
|
|
to dir /hyperion-project/${2}"
|
|
|
|
|
2016-09-07 23:11:08 +02:00
|
|
|
/usr/bin/expect <<-EOD
|
2019-01-06 19:49:56 +01:00
|
|
|
spawn scp $1hyperionsf37@frs.sourceforge.net:/home/frs/project/hyperion-project/$2
|
2016-09-07 23:11:08 +02:00
|
|
|
expect "*(yes/no)*"
|
|
|
|
send "yes\r"
|
|
|
|
expect "*password:*"
|
|
|
|
send "$SFPW\r"
|
|
|
|
expect eof
|
|
|
|
EOD
|
|
|
|
}
|
|
|
|
|
2019-01-06 19:49:56 +01:00
|
|
|
# append current Date to filename (just packages no binaries)
|
|
|
|
appendDate()
|
|
|
|
{
|
|
|
|
D=$(date +%Y-%m-%d)
|
|
|
|
for F in $TRAVIS_BUILD_DIR/deploy/Hy*
|
|
|
|
do
|
|
|
|
mv "$F" "${F%.*}-$D.${F##*.}"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
# append friendly name (just packages no binaries)
|
|
|
|
appendName()
|
|
|
|
{
|
|
|
|
for F in $TRAVIS_BUILD_DIR/deploy/Hy*
|
|
|
|
do
|
|
|
|
mv "$F" "${F%.*}-($DOCKER_NAME).${F##*.}"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
# get all files to deploy (just packages no binaries)
|
|
|
|
getFiles()
|
|
|
|
{
|
|
|
|
FILES=""
|
|
|
|
for f in $TRAVIS_BUILD_DIR/deploy/Hy*;
|
|
|
|
do FILES+="${f} ";
|
|
|
|
done;
|
|
|
|
}
|
2016-09-07 23:11:08 +02:00
|
|
|
|
|
|
|
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
|
|
|
|
if [[ -n $TRAVIS_TAG ]]; then
|
|
|
|
echo "tag upload"
|
2019-01-06 19:49:56 +01:00
|
|
|
appendName
|
|
|
|
appendDate
|
|
|
|
getFiles
|
|
|
|
sf_upload $FILES release
|
2016-09-07 23:11:08 +02:00
|
|
|
elif [[ $TRAVIS_EVENT_TYPE == 'cron' ]]; then
|
|
|
|
echo "cron upload"
|
2019-01-06 19:49:56 +01:00
|
|
|
appendName
|
|
|
|
appendDate
|
|
|
|
getFiles
|
|
|
|
sf_upload $FILES dev/alpha
|
2016-09-07 23:11:08 +02:00
|
|
|
else
|
2019-01-06 19:49:56 +01:00
|
|
|
echo "Direct pushed no upload, PRs not possible"
|
|
|
|
#sf_upload $FILES pr
|
2016-09-07 23:11:08 +02:00
|
|
|
fi
|
|
|
|
fi
|