summaryrefslogtreecommitdiffstats
path: root/scripts/DeployHelpers.py
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-06-15 12:31:07 +0300
committerHenri Sara <hesara@vaadin.com>2015-07-07 10:16:00 +0000
commitff6d55163c13ba0cd764b209dc1252e2992cf2d8 (patch)
treeda89632abc7f9d08d59eda1337d597e38be76720 /scripts/DeployHelpers.py
parent771da038480192a2d49a3672a33850ec3f8e3269 (diff)
downloadvaadin-framework-ff6d55163c13ba0cd764b209dc1252e2992cf2d8.tar.gz
vaadin-framework-ff6d55163c13ba0cd764b209dc1252e2992cf2d8.zip
Add --maven parameter to add mvn commandline parameters
Also adds a --teamcity flag, planned future functionality to add supplied jar dependencies to local maven repo, and flags for setting wildfly autodeployment parameters (url, user, password) Change-Id: I6690cda0d3bfd18d665ffbc61b8502f91f9fd475
Diffstat (limited to 'scripts/DeployHelpers.py')
-rw-r--r--scripts/DeployHelpers.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/scripts/DeployHelpers.py b/scripts/DeployHelpers.py
index c12c38d293..e8e27b98b6 100644
--- a/scripts/DeployHelpers.py
+++ b/scripts/DeployHelpers.py
@@ -11,12 +11,11 @@ except Exception as e:
sys.exit(1)
from requests.auth import HTTPDigestAuth
from os.path import join, expanduser, basename
+from BuildHelpers import parser, getArgs
-# .deploy-url in home folder
-deployUrlFile = join(expanduser("~"), ".deploy-url")
-
-# .deploy-credentials in home folder
-deployCredFile = join(expanduser("~"), ".deploy-credentials")
+parser.add_argument("--deployUrl", help="Wildfly management URL")
+parser.add_argument("--deployUser", help="Deployment user", default=None)
+parser.add_argument("--deployPass", help="Deployment password", default=None)
# Helper for handling the full deployment
# name should end with .war
@@ -50,7 +49,11 @@ def doDeploy(hash, name):
# Helper for adding Content-Type to headers
def doPostJson(**kwargs):
- return requests.post(headers={"Content-Type" : "application/json"}, **kwargs)
+ r = requests.post(headers={"Content-Type" : "application/json"}, **kwargs)
+ # Wildfly gives code 500 when asking for a non-existent deployment
+ if r.status_code == requests.codes.ok or r.status_code == 500:
+ return r
+ r.raise_for_status()
def doUploadWarFile(warFile):
# Upload request, just see the outcome
@@ -70,10 +73,10 @@ def removeDeployment(name):
# Read credentials file and return a HTTPDigestAuth object
def getAuth():
- (deployUser, deployPass) = open(deployCredFile).read().strip().split(",")
- return HTTPDigestAuth(deployUser, deployPass)
+ args = getArgs()
+ return HTTPDigestAuth(args.deployUser, args.deployPass)
# Read the deploy url file and return the url
def getUrl():
- return open(deployUrlFile).read().strip()
-
+ return getArgs().deployUrl
+