aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis-addServer.py45
-rw-r--r--.travis.yml13
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