forked from grails/grails-spring-security-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis-build.sh
executable file
·223 lines (165 loc) · 6.8 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#!/usr/bin/env bash
set -e
export EXIT_STATUS=0
echo "TRAVIS_TAG : $TRAVIS_TAG"
echo "TRAVIS_BRANCH : $TRAVIS_BRANCH"
echo "TRAVIS_PULL_REQUEST : $TRAVIS_PULL_REQUEST"
echo "*******************************"
echo "spring-security-core:check"
echo "*******************************"
./gradlew -Dgeb.env=chromeHeadless :spring-security-core:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "spring-security-core:check failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "spring-security-core:install"
echo "*******************************"
./gradlew :spring-security-core:install --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "spring-security-core:install failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "integration-test-app:check"
echo "*******************************"
./gradlew -Dgeb.env=chromeHeadless :integration-test-app:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "integration-test-app:check failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "misc-group:check"
echo "*******************************"
./gradlew -Dgeb.env=chromeHeadless :misc-group:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "misc-group:check failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "misc-hierarchical-roles:check"
echo "*******************************"
./gradlew -Dgeb.env=chromeHeadless :misc-hierarchical-roles:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "misc-hierarchical-roles:check failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "static functional-test-app:check"
echo "*******************************"
./gradlew -DTESTCONFIG=static -Dgeb.env=chromeHeadless functional-test-app:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "static functional-test-app:check failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "annotation functional-test-app:check"
echo "*******************************"
./gradlew -DTESTCONFIG=annotation -Dgeb.env=chromeHeadless functional-test-app:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "static functional-test-app:annotation failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "requestmap functional-test-app:check"
echo "*******************************"
./gradlew -DTESTCONFIG=requestmap -Dgeb.env=chromeHeadless functional-test-app:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "requestmap functional-test-app:annotation failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "basic functional-test-app:check"
echo "*******************************"
./gradlew -DTESTCONFIG=basic -Dgeb.env=chromeHeadless functional-test-app:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "basic functional-test-app:annotation failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "misc functional-test-app:check"
echo "*******************************"
./gradlew -DTESTCONFIG=misc -Dgeb.env=chromeHeadless functional-test-app:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "misc functional-test-app:annotation failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "putWithParams functional-test-app:check"
echo "*******************************"
./gradlew -DTESTCONFIG=putWithParams -Dgeb.env=chromeHeadless functional-test-app:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "putWithParams functional-test-app:annotation failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "bcrypt functional-test-app:check"
echo "*******************************"
./gradlew -DTESTCONFIG=bcrypt -Dgeb.env=chromeHeadless functional-test-app:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "bcrypt functional-test-app:annotation failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "*******************************"
echo "issue503 functional-test-app:check"
echo "*******************************"
./gradlew -DTESTCONFIG=issue503 -Dgeb.env=chromeHeadless functional-test-app:check --console=plain || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "issue503 functional-test-app:annotation failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
if [ "${TRAVIS_JDK_VERSION}" == "openjdk11" ] ; then
exit $EXIT_STATUS
fi
# Only publish if the branch is on master, and it is not a PR
if [[ -n $TRAVIS_TAG ]] || [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
echo "Publishing archives for branch $TRAVIS_BRANCH"
if [[ -n $TRAVIS_TAG ]]; then
echo "Pushing build to Bintray"
./gradlew :spring-security-core:bintrayUpload || EXIT_STATUS=$?
else
pluginversion=$(<version.txt)
if [[ $pluginversion = *"BUILD-SNAPSHOT"* ]]; then
echo "Publishing snapshot to OJO"
./gradlew :spring-security-core:artifactoryPublish || EXIT_STATUS=$?
fi
fi
./gradlew :spring-security-core:docs || EXIT_STATUS=$?
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/${TRAVIS_REPO_SLUG}.git -b gh-pages gh-pages --single-branch > /dev/null
cd gh-pages
# If this is the master branch then update the snapshot
if [[ $TRAVIS_BRANCH == 'master' ]]; then
mv ../plugin/build/docs/ghpages.html index.html
git add index.html
mkdir -p snapshot
cp -r ../plugin/build/docs/. ./snapshot/
git add snapshot/*
fi
# If there is a tag present then this becomes the latest
if [[ -n $TRAVIS_TAG ]]; then
git rm -rf latest/
mkdir -p latest
cp -r ../plugin/build/docs/. ./latest/
git add latest/*
version="$TRAVIS_TAG" # eg: v3.0.1
version=${version:1} # 3.0.1
majorVersion=${version:0:4} # 3.0.
majorVersion="${majorVersion}x" # 3.0.x
mkdir -p "$version"
cp -r ../plugin/build/docs/. "./$version/"
git add "$version/*"
git rm -rf "$majorVersion"
cp -r ../plugin/build/docs/. "./$majorVersion/"
git add "$majorVersion/*"
fi
git commit -a -m "Updating docs for Travis build: https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID"
git push origin HEAD
cd ..
rm -rf gh-pages
fi
exit $EXIT_STATUS
EXIT_STATUS=0