Skip to content

Commit

Permalink
update travis build to publish to grails central
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed May 9, 2014
1 parent 96211f5 commit 0ec9f8d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 8 deletions.
17 changes: 11 additions & 6 deletions .travis.yml
@@ -1,8 +1,13 @@
language: groovy

jdk:
- openjdk7
- openjdk6
- oraclejdk7

script: ./grailsw clean; ./grailsw "test-app"
- openjdk7
- openjdk6
- oraclejdk7
before_script:
- rm -rf target
script: ./travis-build.sh
env:
global:
- secure: LrVonKDVyNsS3GrErpKeqicnRlwiXQi/LylPL0now266SM1E3clBGyZxA89g7ItqFpqQivwANysTpRL0nO8gd+EkyVG5B19P9Fq0eELLglhinU4T/T5MmWl0a2GFQSyewZDjJDrQQl1zMG3ejbl9QrFauwM4NfPcVMpyON3wjOY=
- secure: eqMOkrSZOS44IZj6cK5i8/JCneWyMRCuhq7Gq+AMSIJFiw6c9ZMkooco/LLL2OV7D9f6yYmZXSDXWLv1scy9/YqrQftYrI7VyVA4Zwb4+MGag2kJ/T7jRtQ/FkYmSBex6VRuzGPN+ZyTdjuaJm3TJoCZwWfGE3Sw9OPYRRLEZAA=
- secure: Ieprqq+UrMPivvu4cZXK4h+Vwl6QTTv/RYKFJddoN7FxHYoSqxXNNz3MBB0OS3DDM3jyHPLapvolWh8/4zis9hKl8R3C2Al00hiNBRtH0urx+IamvUcki6VEl/NSd99QQGCxqZn+zCH//N4nO5bS/u4fVnP5LfC+KBshdbPFrkU=
2 changes: 1 addition & 1 deletion ResourcesGrailsPlugin.groovy
Expand Up @@ -16,7 +16,7 @@ class ResourcesGrailsPlugin {
static DEFAULT_URI_PREFIX = 'static'
static DEFAULT_ADHOC_PATTERNS = ["/images/*", "*.css", "*.js"].asImmutable()

def version = "1.2.8"
def version = "1.2.9-SNAPSHOT"
def grailsVersion = "1.3 > *"

def loadAfter = ['logging'] // retained to ensure correct loading under Grails < 2.0
Expand Down
2 changes: 1 addition & 1 deletion application.properties
@@ -1,4 +1,4 @@
#Grails Metadata file
#Sat Sep 14 14:20:38 MST 2013
app.grails.version=2.3.6
app.grails.version=2.3.8
app.name=resources
38 changes: 38 additions & 0 deletions travis-build.sh
@@ -0,0 +1,38 @@
#!/bin/bash
set -e
rm -rf *.zip
./grailsw refresh-dependencies --non-interactive
./grailsw test-app --non-interactive
./grailsw package-plugin --non-interactive
./grailsw doc --pdf --non-interactive
if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_REPO_SLUG == 'grails-plugins/grails-resources' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
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
filename=$(find . -name "grails-*.zip" | head -1)
filename=$(basename $filename)

if [[ $filename != *-SNAPSHOT* ]]
then
git clone https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG.git -b gh-pages gh-pages --single-branch > /dev/null
cd gh-pages
git rm -rf .
cp -r ../target/docs/. ./
git add *
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
else
echo "SNAPSHOT version, not publishing docs"
fi


./grailsw publish-plugin --no-scm --allow-overwrite --non-interactive
else
echo "Not on master branch, so not publishing"
echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"
echo "TRAVIS_REPO_SLUG: $TRAVIS_REPO_SLUG"
echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST"
fi

0 comments on commit 0ec9f8d

Please sign in to comment.