@@ -5,31 +5,38 @@ if [ -z $TRAVIS ]; then
55 exit 1
66fi
77
8- rm -rf build/maven-releases
9- rm -rf build/maven-snapshots
10- rm -rf maven-repository
8+ if git rev-parse " $TRAVIS_TAG " > /dev/null 2>&1 ; then
9+ echo " Uploading to maven repository..."
1110
12- ./gradlew uploadArchives
11+ rm -rf build/maven-releases
12+ rm -rf build/maven-snapshots
13+ rm -rf maven-repository
1314
14- ./travis_decrypt_file.sh github_deploy_key.gpg
15+ ./gradlew uploadArchives
1516
16- chmod 600 github_deploy_key
17- eval $( ssh-agent -s)
18- ssh-add github_deploy_key
17+ ./travis_decrypt_file.sh github_deploy_key.gpg
1918
20- if [ -d " build/maven-releases " ] ; then
21- git clone --depth 1 -b releases [email protected] :snabble/maven-repository.git maven-repository 22- fi
19+ chmod 600 github_deploy_key
20+ eval $( ssh-agent -s )
21+ ssh-add github_deploy_key
2322
24- if [ -d " build/maven-snapshots" ]; then
25- git clone --depth 1 -b snapshots
[email protected] :snabble/maven-repository.git maven-repository
26- fi
23+ if [ -d " build/maven-releases" ]; then
24+ git clone --depth 1 -b releases
[email protected] :snabble/maven-repository.git maven-repository
25+ fi
26+
27+ if [ -d " build/maven-snapshots" ]; then
28+ git clone --depth 1 -b snapshots
[email protected] :snabble/maven-repository.git maven-repository
29+ fi
2730
28- cd maven-repository
31+ cd maven-repository
2932
30- cp -r ../build/maven-releases/* . 2> /dev/null
31- cp -r ../build/maven-snapshots/* . 2> /dev/null
33+ cp -r ../build/maven-releases/* . 2> /dev/null
34+ cp -r ../build/maven-snapshots/* . 2> /dev/null
35+
36+ git add *
37+ git commit -m " [Travis-CI] release $TRAVIS_TAG commit $TRAVIS_COMMIT "
38+ git push
39+ else
40+ echo " Skipping deployment to maven repository, no tag set"
41+ fi
3242
33- git add *
34- git commit -m " [Travis-CI] release $TRAVIS_TAG commit $TRAVIS_COMMIT "
35- git push
0 commit comments