2013-01-13 23:40:30 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2014-01-22 02:26:42 +00:00
|
|
|
# This file is part of the phpseclib project.
|
2013-01-13 23:40:30 +00:00
|
|
|
#
|
|
|
|
# (c) Andreas Fischer <bantu@phpbb.com>
|
|
|
|
#
|
|
|
|
# For the full copyright and license information, please view the LICENSE
|
|
|
|
# file that was distributed with this source code.
|
|
|
|
#
|
|
|
|
|
|
|
|
USERNAME='phpseclib'
|
|
|
|
HOSTNAME='phpseclib.bantux.org'
|
2013-01-16 22:43:28 +00:00
|
|
|
HOSTRSAF='09:40:96:14:6a:cd:67:46:17:e5:b4:39:24:24:6e:9d'
|
2013-01-13 23:40:30 +00:00
|
|
|
LDIRNAME='code_coverage'
|
|
|
|
RDIRNAME='code_coverage'
|
2014-01-22 02:26:42 +00:00
|
|
|
ID_RSA='travis/code_coverage_id_rsa'
|
2013-01-13 23:40:30 +00:00
|
|
|
|
2013-01-16 22:44:29 +00:00
|
|
|
# Install expect if necessary
|
2013-01-13 23:40:30 +00:00
|
|
|
if ! which expect > /dev/null
|
|
|
|
then
|
|
|
|
sudo apt-get update -qq
|
|
|
|
sudo apt-get install -qq expect
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Workaround for rsync not creating target directories with depth > 1
|
|
|
|
mv "$LDIRNAME" "x$LDIRNAME"
|
2013-11-23 19:02:41 +00:00
|
|
|
RROOT="$RDIRNAME/$TRAVIS_BRANCH/$TRAVIS_BUILD_NUMBER"
|
|
|
|
mkdir -p "$RROOT"
|
|
|
|
mv "x$LDIRNAME" "$RROOT/PHP-$TRAVIS_PHP_VERSION/"
|
2013-01-13 23:40:30 +00:00
|
|
|
|
2013-01-16 22:27:28 +00:00
|
|
|
# Update latest symlink
|
2013-11-23 19:00:44 +00:00
|
|
|
ln -s "$TRAVIS_BUILD_NUMBER" "$RDIRNAME/$TRAVIS_BRANCH/latest"
|
2013-01-16 22:27:28 +00:00
|
|
|
|
2013-01-13 23:40:30 +00:00
|
|
|
# Stop complaints about world-readable key file.
|
|
|
|
chmod 600 "$ID_RSA"
|
|
|
|
|
|
|
|
export RSYNC_RSH="ssh -4 -i $ID_RSA -o ConnectTimeout=5"
|
2013-01-16 22:27:28 +00:00
|
|
|
RSYNC_OPT="--recursive --times --links --progress"
|
2013-01-13 23:40:30 +00:00
|
|
|
|
|
|
|
expect << EOF
|
|
|
|
spawn rsync $RSYNC_OPT "$RDIRNAME/" "$USERNAME@$HOSTNAME:$RDIRNAME/"
|
|
|
|
|
2013-01-16 22:43:28 +00:00
|
|
|
expect "RSA key fingerprint is $HOSTRSAF."
|
2013-01-13 23:40:30 +00:00
|
|
|
send "yes\n"
|
|
|
|
|
|
|
|
expect "Enter passphrase for key '$ID_RSA':"
|
|
|
|
send "$CODE_COVERAGE_PASSPHRASE\n"
|
|
|
|
|
|
|
|
expect eof
|
|
|
|
EOF
|