diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-01-11 22:37:00 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-01-11 23:38:07 +0100 |
commit | 3540c9b84b11338554ec66cf2bb3a4cc4fc7c4d5 (patch) | |
tree | 15e8102fa6880f5ba7927ef7ce32320c0425a923 | |
parent | e5b20aa811ed2180d01e71d96c3d5d2ffa886c5f (diff) | |
download | app.sh-booter-jetty-3540c9b84b11338554ec66cf2bb3a4cc4fc7c4d5.tar.gz app.sh-booter-jetty-3540c9b84b11338554ec66cf2bb3a4cc4fc7c4d5.tar.bz2 app.sh-booter-jetty-3540c9b84b11338554ec66cf2bb3a4cc4fc7c4d5.tar.xz app.sh-booter-jetty-3540c9b84b11338554ec66cf2bb3a4cc4fc7c4d5.zip |
o Trying out travis-ci.org.
-rw-r--r-- | .travis-addServer.py | 45 | ||||
-rw-r--r-- | .travis.yml | 13 |
2 files changed, 58 insertions, 0 deletions
diff --git a/.travis-addServer.py b/.travis-addServer.py new file mode 100644 index 0000000..66de4eb --- /dev/null +++ b/.travis-addServer.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +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() diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..2b8c677 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: java + +env: + global: + - SONATYPE_USERNAME=80ymBYBJ + - secure: "EhM8g7ZMgU1BH/DZCB15IF0VAuClP6gb4KGSDRRAIEFNE02VCFFYdU1u2jaz\nzxZ5SU8AlXinZ8Q0tjP9JkYcq4Z+MNMHxIRzDTm+L2rvfHKol20nNrEHyb69\nj1GFpZvd4Ryt2Yfo89D/Rr7GRjx+6WnSFvQk1MWbKlLcDJwLQCE=" + +install: "mvn -DskipTests -U -B install" + +after_success: + - python .travis-addServer.py + # No need to run clean or run tests when simply deploying. + - mvn -DskipTests deploy -B --settings ~/.m2/mySettings.xml |