-
Notifications
You must be signed in to change notification settings - Fork 4
/
deploy.sh
54 lines (38 loc) · 1.78 KB
/
deploy.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
CURRENT_COMMIT=`git rev-parse HEAD`
echo "Moving to home dir"
cd ..
echo `pwd`
echo "Running deployment script..."
# Change the branch used if applicable (e.g. gh-pages)
echo "Cloning master branch..."
# Hide output since we use an access token here
#git clone -b master "https://${GH_TOKEN}@${GH_REF}" _deploy > /dev/null 2>&1 || exit 1
git clone -b master https://${GH_TOKEN}@github.com/Vitens/phreeqpython.git _deploy || exit 1
#TRAVIS_OS_NAME="osx"
if [ "$TRAVIS_OS_NAME" == "osx" ]; then export RELEASE_PKG_FILE="/Users/travis/build/Vitens/VIPhreeqc/build/lib/libiphreeqc-3.3.7.dylib"; fi
if [ "$TRAVIS_OS_NAME" == "osx" ]; then export DEPLOY_PKG_FILE="viphreeqc.dylib"; fi
if [ "$TRAVIS_OS_NAME" == "linux" ]; then export RELEASE_PKG_FILE="/home/travis/build/Vitens/VIPhreeqc/build/lib/libiphreeqc-3.3.7.so"; fi
if [ "$TRAVIS_OS_NAME" == "linux" ]; then export DEPLOY_PKG_FILE="viphreeqc.so"; fi
# install sshpass
if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb ; fi
###
# Copy your source files to a deployment directory
echo "uploading built files"
export SSHPASS=$DEPLOY_PASS
cp $RELEASE_PKG_FILE $DEPLOY_PKG_FILE
ls -l
sshpass -e scp -o StrictHostKeyChecking=no -v $DEPLOY_PKG_FILE $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
### trigger nosetests
# Move into deployment directory
cd _deploy
echo "Committing and pushing to phreeqpython GH to trigger nosetests"
git config user.name "Travis CI"
git config user.email "travis@vitens.nl"
# Commit changes, allowing empty changes (when unchanged)
git add -A
git commit --allow-empty -m "Deploying build for $CURRENT_COMMIT" || exit 1
# Push to branch
git push origin master > /dev/null 2>&1 || exit 1
echo "Pushed deployment successfully"
exit 0