forked from grails/grails-data-mapping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis-build.sh
executable file
·70 lines (52 loc) · 2.05 KB
/
travis-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
63
64
65
66
67
export GRADLE_OPTS="-Xmx2048m -Xms256m -XX:MaxPermSize=768m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError"
EXIT_STATUS=0
./gradlew grails-datastore-gorm-hibernate:test || EXIT_STATUS=$?
./gradlew grails-datastore-gorm-hibernate4:test || EXIT_STATUS=$?
./gradlew grails-datastore-gorm-mongodb:test || EXIT_STATUS=$?
./gradlew grails-datastore-gorm-redis:test || EXIT_STATUS=$?
./gradlew grails-datastore-gorm-test:test || EXIT_STATUS=$?
version=$(grep 'projectVersion =' build.gradle)
version=${version//[[:blank:]]/}
version="${version#*=}";
version=${version//\"/}
releaseType=$(grep 'releaseType =' build.gradle | egrep -v ^[[:blank:]]*\/\/ | egrep -v ^[[:blank:]]*isBuildSnapshot)
releaseType=${releaseType//[[:blank:]]/}
releaseType="${releaseType#*=}";
releaseType=${releaseType//\"/}
echo "Project Version: $version $releaseType"
if [[ $releaseType != *-SNAPSHOT* ]]
then
./gradlew allDocs
base_dir=$(pwd)
echo "BASE DIR = $base_dir"
git config --global user.name "$GIT_NAME"
git config --global user.email "$GIT_EMAIL"
git config --global credential.helper "store --file=~/.git-credentials"
echo "https://$GH_TOKEN:@github.com" > ~/.git-credentials
git clone https://${GH_TOKEN}@github.com/grails/grails-data-mapping.git -b gh-pages gh-pages --single-branch > /dev/null
cd gh-pages
echo "Making directory for Version: $version"
mkdir -p "$version"
cd "$version"
current_dir=$(pwd)
git rm -rf .
mkdir -p "$current_dir"
echo "Current Directory: $current_dir"
cp -r "$base_dir/build/docs/." "$current_dir/"
cd ..
mkdir -p current
cd current
current_dir=$(pwd)
git rm -rf .
mkdir -p "$current_dir"
echo "Current Directory: $current_dir"
cp -r "$base_dir/build/docs/." "$current_dir/"
cd ..
cp -r "$base_dir/build/docs/." ./
git add .
git commit -a -m "Updating docs for Travis build: https://travis-ci.org/grails/grails-data-mapping/builds/$TRAVIS_BUILD_ID"
git push origin HEAD
cd ..
rm -rf gh-pages
fi
exit $EXIT_STATUS