Skip to content

Commit

Permalink
Publish snapshot to Sonatype OSSRH when build succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
testinfected committed Apr 30, 2014
1 parent 9b065cd commit bfb7e32
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .scripts/publish-to-sonatype.sh
@@ -0,0 +1,22 @@
#!/bin/bash

if [ "$TRAVIS_REPO_SLUG" == "testinfected/molecule" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
if [[ $(gradle -q version) != *SNAPSHOT* ]]; then
echo 'Travis will only publish snapshots.'
exit 0
fi

echo -e "Publishing to Sonatype OSS Maven Repository..."

gradle uploadArchives -PnexusUsername="${SONATYPE_USERNAME}" -PnexusPassword="${SONATYPE_PASSWORD}"

RETVAL=$?

if [ $RETVAL -eq 0 ]; then
echo -e '\nPublished!'
exit 0
else
echo -e '\nPublication failed.'
exit 1
fi
fi
12 changes: 6 additions & 6 deletions gradle/publish.gradle
Expand Up @@ -7,9 +7,9 @@ ext {

modifyPom {
project {
name 'Molecule'
description 'A Rack inspired web micro-framework for Java'
url 'http://vtence.com/molecule'
name 'CLI'
description 'A lightweight Command Line Interface for Java'
url 'http://vtence.com/cli'
packaging 'jar'
licenses {
license {
Expand All @@ -19,9 +19,9 @@ modifyPom {
}
}
scm {
url 'https://github.com/testinfected/molecule'
connection 'scm:git:https://github.com/testinfected/molecule.git'
developerConnection 'scm:git@github.com:testinfected/molecule.git'
url 'https://github.com/testinfected/cli'
connection 'scm:git:https://github.com/testinfected/cli.git'
developerConnection 'scm:git@github.com:testinfected/cli.git'
}
developers {
developer {
Expand Down

0 comments on commit bfb7e32

Please sign in to comment.