Skip to content

Commit

Permalink
Test Travis publish
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Mar 10, 2015
1 parent 0a20953 commit f0ec940
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 98 deletions.
42 changes: 23 additions & 19 deletions .travis.yml
Expand Up @@ -22,24 +22,28 @@ env:
- secure: HvROZ9kWW9GvKw4MZKEhsgUHQh/xSVrbOr/enq9fFX4+Cf7MGXc1ySlNHhDTV1mGdP6QTIl7CI3Xz3u9yCgXy4m3eyTgVUzeQOUAv1roiR8ajv1PleVGUOqMreejUUsFDHR1gmNR9S17hJoNZPBanB43R9tJDQVvrEUnV38Wr48=
- secure: FYgiX7uSiQFql2bQsOfHsTypik4/hArAFMaMcm05MoXBHyb5tl3VXwo3jEBp0MYsH9iIIJ8crlLy4ylm+8XMKOq300zZk2feqQME4x2DXxlUgmfZkbnvY+iUpmLa7OoMAqUV8ardbBrXVn/gQjDH9jvVcX+Gv7KnKE2xyzI0lQY=
- secure: SbEE24W2zMdao0ArFBHTDP7ntDJn3wmaVl/T42ahkzQUSjQiND+TXwJLhaNADJDIyLg0zmFEIKUk7g7HUMOdw5a2foZbz7BESkz4Nnuhw5O7CgJdIYL6lfLNPkOA6pc7H7D0D5J39vLk4PDqpOJxUw+sgaH2gg2F13kWFk8YZVY=
matrix:
- GORM_IMPL=test
- GORM_IMPL=hibernate
- GORM_IMPL=hibernate4
- GORM_IMPL=mongodb
- GORM_IMPL=redis
- GORM_IMPL=cassandra
- GORM_IMPL=neo4j
- GORM_IMPL=restclient
matrix:
fast_finish: true
- secure: D604qHBpW7UuFuxkhu/cqVzpEESkkipWTKyz3j75i2k+ocQXcYXSj3zDMk4Hmo/iTHszwCgXk1w/5aj+mxRVecewmXmpFk3Q63qPvJprAjcvatmxp82aBmmpPd9GHjKbyLmu6Gn3R8QtX6yAT75T9lf4Y1FMi9mVwFPOtLiSEs0=
# matrix:
# - GORM_IMPL=test
# - GORM_IMPL=hibernate
# - GORM_IMPL=hibernate4
# - GORM_IMPL=mongodb
# - GORM_IMPL=redis
# - GORM_IMPL=cassandra
# - GORM_IMPL=neo4j
# - GORM_IMPL=restclient
before_install:
- openssl aes-256-cbc -pass pass:$SIGNING_PASSPHRASE -in secring.gpg.enc -out secring.gpg
-d
#matrix:
# fast_finish: true
script: ./travis-build.sh
install: true
after_success:
- python ./travis/travis_after_all.py
- export $(cat .to_export_back)
- ./travis-publish.sh
after_failure:
- python ./travis/travis_after_all.py
- export $(cat .to_export_back)
- ./travis-after-failure.sh
#after_success:
#- python ./travis/travis_after_all.py
#- export $(cat .to_export_back)
#- ./travis-publish.sh
#after_failure:
#- python ./travis/travis_after_all.py
#- export $(cat .to_export_back)
#- ./travis-after-failure.sh
99 changes: 50 additions & 49 deletions build.gradle
Expand Up @@ -7,6 +7,7 @@ buildscript {
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1"
classpath "com.netflix.nebula:gradle-extra-configurations-plugin:2.2.0"
classpath 'com.bmuschko:gradle-nexus-plugin:2.3'
}
}

Expand Down Expand Up @@ -41,6 +42,9 @@ project.ext {
isBuildSnapshot = releaseType == "BUILD-SNAPSHOT"

servletApiVersion = "3.0.1"

nexusUsername = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
nexusPassword = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
}

def groovyMajorVersion = groovyVersion[0..2]
Expand Down Expand Up @@ -114,13 +118,52 @@ subprojects {

version = "${projectVersion}.${releaseType}"
group = "org.grails"
ext {
pomInfo = {
delegate.name 'Grails GORM'
delegate.description 'GORM - Grails Data Access Framework'
delegate.url 'http://grails.org/'

delegate.licenses {
delegate.license {
delegate.name 'The Apache Software License, Version 2.0'
delegate.url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
delegate.distribution 'repo'
}
}

delegate.scm {
delegate.url 'scm:git@github.com:grails/grails-data-mapping.git'
delegate.connection 'scm:git@github.com:grails/grails-data-mapping.git'
delegate.developerConnection 'scm:git@github.com:grails/grails-data-mapping.git'
}


delegate.developers {
delegate.developer {
delegate.id 'graemerocher'
delegate.name 'Graeme Rocher'
}
delegate.developer {
delegate.id 'jeffscottbrown'
delegate.name 'Jeff Brown'
}
delegate.developer {
delegate.id 'burtbeckwith'
delegate.name 'Burt Beckwith'
}
}

}
}


def isStandardGroovyMavenProject = isGroovyProject(project)

if (isStandardGroovyMavenProject) {
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'com.bmuschko.nexus'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'idea'
Expand Down Expand Up @@ -267,15 +310,6 @@ subprojects {
}

if (isStandardGroovyMavenProject) {
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

configure([javadoc]) {
options.encoding "UTF-8"
Expand All @@ -284,10 +318,12 @@ subprojects {
options.jFlags "-Xms64M", "-Xmx512M", "-XX:MaxPermSize=256m"
}

artifacts {
archives jar
archives sourcesJar
archives javadocJar
modifyPom {
delegate.project {
def updatePom = pomInfo.clone()
updatePom.delegate = delegate
updatePom()
}
}

publishing {
Expand Down Expand Up @@ -321,42 +357,7 @@ subprojects {
def xml = asNode()
def dependency = xml.dependencies.find { dep -> dep.artifactId == 'slf4j-simple' }
dependency?.optional = true
xml.children().last() + {
delegate.name 'Grails GORM'
delegate.description 'GORM - Grails Data Access Framework'
delegate.url 'http://grails.org/'

delegate.licenses {
delegate.license {
delegate.name 'The Apache Software License, Version 2.0'
delegate.url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
delegate.distribution 'repo'
}
}

delegate.scm {
delegate.url 'scm:git@github.com:grails/grails-data-mapping.git'
delegate.connection 'scm:git@github.com:grails/grails-data-mapping.git'
delegate.developerConnection 'scm:git@github.com:grails/grails-data-mapping.git'
}


delegate.developers {
delegate.developer {
delegate.id 'graemerocher'
delegate.name 'Graeme Rocher'
}
delegate.developer {
delegate.id 'jeffscottbrown'
delegate.name 'Jeff Brown'
}
delegate.developer {
delegate.id 'burtbeckwith'
delegate.name 'Burt Beckwith'
}
}

}
xml.children().last() + pomInfo
}

}
Expand Down
Binary file added secring.gpg.enc
Binary file not shown.
61 changes: 32 additions & 29 deletions travis-build.sh
@@ -1,36 +1,39 @@
#!/bin/bash
EXIT_STATUS=0

case "$GORM_IMPL" in
hibernate)
./gradlew grails-datastore-gorm-hibernate:test || EXIT_STATUS=$?
;;
hibernate4)
./gradlew grails-datastore-gorm-hibernate4:test --stacktrace || EXIT_STATUS=$?
;;
mongodb)
./gradlew grails-datastore-gorm-mongodb:test --stacktrace || EXIT_STATUS=$?
;;
redis)
./gradlew grails-datastore-gorm-redis:test || EXIT_STATUS=$?
;;
cassandra)
# wait for Cassandra to start up
sleep 5
./gradlew grails-datastore-gorm-cassandra:test || EXIT_STATUS=$?
;;
neo4j)
./gradlew grails-datastore-gorm-neo4j:test || EXIT_STATUS=$?
;;
restclient)
./gradlew grails-datastore-gorm-rest-client:test || EXIT_STATUS=$?
;;
*)
./gradlew testClasses || EXIT_STATUS=$?
./gradlew grails-datastore-gorm-test:test || EXIT_STATUS=$?
;;
esac
#case "$GORM_IMPL" in
# hibernate)
# ./gradlew grails-datastore-gorm-hibernate:test || EXIT_STATUS=$?
# ;;
# hibernate4)
# ./gradlew grails-datastore-gorm-hibernate4:test --stacktrace || EXIT_STATUS=$?
# ;;
# mongodb)
# ./gradlew grails-datastore-gorm-mongodb:test --stacktrace || EXIT_STATUS=$?
# ;;
# redis)
# ./gradlew grails-datastore-gorm-redis:test || EXIT_STATUS=$?
# ;;
# cassandra)
# # wait for Cassandra to start up
# sleep 5
# ./gradlew grails-datastore-gorm-cassandra:test || EXIT_STATUS=$?
# ;;
# neo4j)
# ./gradlew grails-datastore-gorm-neo4j:test || EXIT_STATUS=$?
# ;;
# restclient)
# ./gradlew grails-datastore-gorm-rest-client:test || EXIT_STATUS=$?
# ;;
# *)
# ./gradlew testClasses || EXIT_STATUS=$?
# ./gradlew grails-datastore-gorm-test:test || EXIT_STATUS=$?
# ;;
#esac
#


./travis-publish.sh
exit $EXIT_STATUS


Expand Down
3 changes: 2 additions & 1 deletion travis-publish.sh
Expand Up @@ -19,8 +19,9 @@ if [[ $TRAVIS_REPO_SLUG == "grails/grails-data-mapping" && $TRAVIS_PULL_REQUEST

echo "Publishing archives"

gpg --keyserver keyserver.ubuntu.com --recv-key $SIGNING_KEY
if [[ $TRAVIS_TAG =~ ^v[[:digit:]] ]]; then
./gradlew bintrayUpload || EXIT_STATUS=$?
./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/secring.gpg" uploadArchives publish || EXIT_STATUS=$?
else
./gradlew publish || EXIT_STATUS=$?
fi
Expand Down

0 comments on commit f0ec940

Please sign in to comment.