hyperion.ng/.travis/travis_deploy.sh

65 lines
1.2 KiB
Bash
Raw Normal View History

2016-09-07 23:11:08 +02:00
#!/bin/bash
# sf_upload <FILES> <sf_dir>
2016-09-07 23:11:08 +02:00
sf_upload()
{
echo "Uploading following files: ${1}
to dir /hyperion-project/${2}"
2016-09-07 23:11:08 +02:00
/usr/bin/expect <<-EOD
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
}
# 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"
appendName
appendDate
getFiles
sf_upload $FILES release
2016-09-07 23:11:08 +02:00
elif [[ $TRAVIS_EVENT_TYPE == 'cron' ]]; then
echo "cron upload"
appendName
appendDate
getFiles
sf_upload $FILES dev/alpha
2016-09-07 23:11:08 +02:00
else
echo "Direct pushed no upload, PRs not possible"
#sf_upload $FILES pr
2016-09-07 23:11:08 +02:00
fi
fi