forked from metafacture/metafacture-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added auto snapshot deployment with travis.
(first try ;-)
- Loading branch information
mgeipel
committed
Mar 27, 2013
1 parent
45ebc8a
commit 8819cc3
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
language: java | ||
jdk: | ||
- openjdk6 | ||
|
||
env: | ||
global: | ||
- SONATYPE_USERNAME=culturegraph | ||
- secure: "SUVokr6x5uqPnSBgtc/5AqN2ZKXhbW5/lIt0UQ3agVXH6nGuINdgZ3mNN0v2VrzxXpc0NUldwrDqfwY9r1JJZFq4jX+6iVRQ3b8e5efGKO+eEFAPna48Z5UE6RgGjHEnY7h7m/ptQoLouR514Z31ZUTQpq7vTyGSNZyEOvBZOQ4=" | ||
|
||
after_success: | ||
- python travis-ci/configure-mvn.py | ||
- mvn clean deploy --settings ~/.m2/mySettings.xml -Dgpg.skip=true -Psonatype-oss-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Script from https://gist.github.com/neothemachine/4060735 | ||
# | ||
import sys | ||
import os | ||
import os.path | ||
import xml.dom.minidom | ||
|
||
if os.environ["TRAVIS_SECURE_ENV_VARS"] == "false": | ||
print "no secure env vars available, skipping deployment" | ||
sys.exit() | ||
|
||
homedir = os.path.expanduser("~") | ||
|
||
m2 = xml.dom.minidom.parse(homedir + '/.m2/settings.xml') | ||
settings = m2.getElementsByTagName("settings")[0] | ||
|
||
serversNodes = settings.getElementsByTagName("servers") | ||
if not serversNodes: | ||
serversNode = m2.createElement("servers") | ||
settings.appendChild(serversNode) | ||
else: | ||
serversNode = serversNodes[0] | ||
|
||
sonatypeServerNode = m2.createElement("server") | ||
sonatypeServerId = m2.createElement("id") | ||
sonatypeServerUser = m2.createElement("username") | ||
sonatypeServerPass = m2.createElement("password") | ||
|
||
idNode = m2.createTextNode("sonatype-nexus-snapshots") | ||
userNode = m2.createTextNode(os.environ["SONATYPE_USERNAME"]) | ||
passNode = m2.createTextNode(os.environ["SONATYPE_PASSWORD"]) | ||
|
||
sonatypeServerId.appendChild(idNode) | ||
sonatypeServerUser.appendChild(userNode) | ||
sonatypeServerPass.appendChild(passNode) | ||
|
||
sonatypeServerNode.appendChild(sonatypeServerId) | ||
sonatypeServerNode.appendChild(sonatypeServerUser) | ||
sonatypeServerNode.appendChild(sonatypeServerPass) | ||
|
||
serversNode.appendChild(sonatypeServerNode) | ||
|
||
m2Str = m2.toxml() | ||
f = open(homedir + '/.m2/mySettings.xml', 'w') | ||
f.write(m2Str) | ||
f.close() |