forked from fgpv-vpgf/fgpv-vpgf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devdeploy.sh
30 lines (23 loc) · 840 Bytes
/
devdeploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
SSHSRV="[email protected]"
DESTDIR="/home/travis/www"
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
openssl aes-256-cbc -k "$PW" -out ~/.ssh/id_rsa -in devkey.enc -d
echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
chmod 600 ~/.ssh/id_rsa
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa
if [ "$TRAVIS_REPO_SLUG" == "fgpv-vpgf/fgpv-vpgf" ]; then
if [ -n "$TRAVIS_TAG" ]; then
DESTDIR="$DESTDIR/$TRAVIS_TAG/"
else
DESTDIR="$DESTDIR/$TRAVIS_BRANCH/"
fi
else
USER=${TRAVIS_REPO_SLUG/\/fgpv-vpgf/}
DESTDIR="$DESTDIR/users/$USER/$TRAVIS_BRANCH/"
fi
echo "Destintation: $DESTDIR"
ssh "$SSHSRV" mkdir -p "$DESTDIR/dist"
rsync -av --delete "build/" "$SSHSRV:$DESTDIR"
rsync -av "dist/" "$SSHSRV:$DESTDIR/dist"
fi