Update travis to create a "latest" symlink.

This commit is contained in:
Joseph Lenox 2018-02-24 19:01:48 -06:00
parent 113308c317
commit c7e3e7f22c
2 changed files with 40 additions and 0 deletions

View File

@ -16,6 +16,8 @@ after_success:
- LD_LIBRARY_PATH=$WXDIR/lib package/linux/make_archive.sh linux-x64
- package/linux/appimage.sh x86_64
- package/deploy/sftp.sh linux ~/slic3r-upload.rsa *.bz2 Slic3r*.AppImage
- package/deploy/sftp-symlink.sh linux ~/slic3r-upload.rsa AppImage Slic3r*.AppImage
- package/deploy/sftp-symlink.sh linux ~/slic3r-upload.rsa bz2 *.bz2
branches:
only:
- master

View File

@ -0,0 +1,38 @@
#!/bin/bash
# Prerequisites
# Environment Variables:
# UPLOAD_USER - user to upload to sftp server
# KEY is assumed to be path to a ssh key for UPLOAD_USER
DIR=$1
shift
KEY=$1
shift
EXT=$1
shift
FILES=$*
source $(dirname $0)/../common/util.sh
set_pr_id
set_branch
if [ ! -z ${PR_ID+x} ] || [ $current_branch != "master" ]; then
DIR=${DIR}/branches
fi
if [ -s $KEY ]; then
for i in $FILES; do
filepath=$(readlink -f "$i")
tmpfile=$(mktemp)
echo "rm -f slic3r-${current_branch}-latest.${EXT}" > $tmpfile
echo "symlink slic3r-${current_branch}-latest.${EXT} $filepath" >> $tmpfile
sftp -b $tmpfile -i$KEY "${UPLOAD_USER}@dl.slic3r.org:$DIR/"
result=$?
if [ $? -eq 1 ]; then
echo "Error with SFTP symlink"
exit $result;
fi
done
else
echo "$KEY is not available, not symlinking."
fi
exit $result