forked from pixl8/Preside-CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·62 lines (50 loc) · 1.85 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
cd `dirname $0`
CWD="`pwd`"
echo "";
echo "--------------------------------------------------------";
echo "Welcome to the PresideCMS Test runner and build suite :)";
echo "--------------------------------------------------------";
echo "";
echo "This script will install dependencies, run tests, and conditionally build docs and package preside into a ZIP file.";
echo "Each of these operations can be run independantly with the following commands:";
echo "";
echo "box install - installs dependencies";
echo "./test.sh - runs tests";
echo "./support/docs/build.sh - builds documentation";
echo "ant -f ./support/build/build.xml - packages PresideCMS into a zip file";
echo "";
echo "The script has dependencies on CommandBox, ant + an accessible database for running the test suite.";
echo "";
echo "-------------------------------------------------------";
echo "";
echo "Installing dependencies via box.json...";
echo "";
box install --force
echo "";
echo "Running tests (please be patient, expect this to take several minutes)...";
echo "";
./test.sh
if [[ $TRAVIS_PULL_REQUEST == 'true' ]] ; then
echo "Finished. (not packaging up docs or source due to running in a pull request)."
exit 0;
fi
if [[ $TRAVIS_TAG == v* ]] ; then
./support/docs/build.sh
echo "";
echo "";
else
echo "Skipping docs build, not on a release tag in a travis build. To build the docs yourself, run ./support/docs/build.sh"
fi
if [[ $TRAVIS_TAG == v* ]] || [[ $TRAVIS_BRANCH == release* ]] ; then
echo "Packaging up as zip file...";
echo "";
echo "";
ant -f support/build/build.xml -Dbranch=$TRAVIS_BRANCH -Dtag=$TRAVIS_TAG
else
echo "Skipping packaging, not on stable or release branch in a travis build. To package preside yourself, run ant -f ./support/build/build.xml"
fi
echo "";
echo "All done :)";
echo "";
exit 0;