-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
54 lines (46 loc) · 2.41 KB
/
.travis.yml
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
language: groovy
jdk:
- oraclejdk7
branches:
only:
- master
before_install:
- rm -rf ~/.gvm
- curl -s get.gvmtool.net > ~/install_gvm.sh
- chmod 775 ~/install_gvm.sh
- ~/install_gvm.sh
- echo "gvm_auto_answer=true" > ~/.gvm/etc/config
- source ~/.gvm/bin/gvm-init.sh
- GRAILS_VERSION=`grep '^\s*app.grails.version' application.properties | sed -e 's/^\s*app\.grails\.version=//g'
| tr -d "\r"`
- echo "GRAILS_VERSION:$GRAILS_VERSION"
- gvm install grails $GRAILS_VERSION || true
before_script:
- wget -q https://raw.githubusercontent.com/AtlasOfLivingAustralia/travis-build-configuration/master/ala_common.sh
- chmod +x ala_common.sh
- source ./ala_common.sh
- mkdir -p ~/.m2
- wget -q -O ~/.m2/settings.xml https://raw.githubusercontent.com/AtlasOfLivingAustralia/travis-build-configuration/master/travis_maven_settings.xml
- MAVEN_REPO_ID=$ALA_MAVEN_REPO_ID
- GROUP_ID=$ALA_MAVEN_GROUP_ID
- RELEASE_OR_SNAPSHOT="snapshots"
- grep '^\s*app\.version=' ./application.properties | grep -q "\-SNAPSHOT"; if [ "$?" = "1" ]; then RELEASE_OR_SNAPSHOT="releases"; fi;
- MAVEN_REPO_URL=$ALA_MAVEN_REPO_URL/$RELEASE_OR_SNAPSHOT
- APP_NAME=`grep "^\s*app\.name=" ./application.properties | sed -e "s/^\s*app\.name=//g" | tr -d "\r"`
- APP_VERSION=`grep "^\s*app\.version=" ./application.properties | sed -e "s/^\s*app\.version=//g" | tr -d "\r"`
- echo "ALA_MAVEN_REPO_URL:$ALA_MAVEN_REPO_URL"
- echo "ALA_MAVEN_REPO_ID:$ALA_MAVEN_REPO_ID"
- echo "ALA_MAVEN_GROUP_ID:$ALA_MAVEN_GROUP_ID"
- echo "RELEASE_OR_SNAPSHOT:$RELEASE_OR_SNAPSHOT"
- echo "MAVEN_REPO_URL:$MAVEN_REPO_URL"
- echo "MAVEN_REPO_ID:$MAVEN_REPO_ID"
- echo "GROUP_ID:$GROUP_ID"
- echo "APP_NAME:$APP_NAME"
- echo "APP_VERSION:$APP_VERSION"
script:
- grails clean && grails refresh-dependencies --non-interactive && grails prod war --non-interactive
after_success: '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && mvn -e deploy:deploy-file -DartifactId=$APP_NAME -DgroupId=$GROUP_ID -Dpackaging=war -Dversion=$APP_VERSION -Dfile=target/$APP_NAME-$APP_VERSION.war -DrepositoryId=$MAVEN_REPO_ID -Durl=$MAVEN_REPO_URL'
env:
global:
- secure: SJngsUR7nEuxT/LU3o7ZYEboNB6O3zRzGhnjfjhQQnvuQYdUK96S7G7dG8TWpbxsDbPWgou74U99zEbMey5RwLWVdlAfDB2jcyD5QQfrxOvC4UcoLwKSw/lXeL0nBDoRMN/ZsLvTLBVjvSF3kSL29TXrolYhAQspUTEdmw0vR2E=
- secure: T/U+jLIoFsydKMLKnUTcBlAE5yfJ7s9IiJjYQWqKXzPuT8imA2XJrSj39fUUtdTVrbOFUUONX6CEHXX2vRo0JDyr3NNMwqWNy5/xTDTII5ZLPkTUVxb2pt6rZuqIWvQrdsw/VJSbF+Z5l01HtBRijkSRDS8DJHuzecvvsvdGHt4=