forked from motech/motech
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_build.sh
31 lines (28 loc) · 1.17 KB
/
run_build.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
#!/usr/bin/env bash
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ "$DB" = "psql" ]; then
mvn -Dmotech.sql.password=password -Dmotech.sql.user=postgres -Dmaven.test.failure.ignore=false -Dmotech.sql.driver=org.postgresql.Driver -Dmotech.sql.dbtype=psql -Dmotech.sql.url=jdbc:postgresql://localhost:5432/ clean install -PIT -U
elif [ "$DB" = "mysql" ] && [ "$REPOSITORY" = "motech" ]; then
mvn clean install -PIT -U
fi
elif [ "$TRAVIS_BRANCH" = "master" ] && [ "$DB" = "mysql" ]; then
MOTECH_LOCATION=`pwd`
if [ "$REPOSITORY" = "motech" ]; then
npm install --save-dev travis-after-all
mvn clean install -PIT -U
elif [ "$REPOSITORY" = "modules" ]; then
#Download and test Modules
git clone https://github.com/motech/modules.git ../modules -b master --single-branch
cd ../modules/
npm install --save-dev travis-after-all
mvn clean install -PIT -U
fi
declare exitCode
$(npm bin)/travis-after-all
exitCode=$?
if [ $exitCode -eq 0 ]; then
#Deploy MOTECH
cd $MOTECH_LOCATION
mvn -Dmaven.test.skip=true --settings deploy-settings.xml clean deploy -U
fi
fi