Created
August 25, 2012 19:33
-
-
Save nialdarbey/3469899 to your computer and use it in GitHub Desktop.
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
private String cloudHubUrl = "https://cloudhub.io"; | |
@Override | |
public void execute() throws BuildException { | |
FileChecker checker = new FileChecker(getLocation()); | |
checker.checkFile(applicationFile, "application file", false, false); | |
try { | |
Client client = Client.create(); | |
client.addFilter(new HTTPBasicAuthFilter(username, password)); | |
WebResource webResource = client.resource(cloudHubUrl); | |
String domainCreationPath = "/api/applications/" + domain; | |
String appDeploymentPath = domainCreationPath + "/deploy"; | |
webResource.path(appDeploymentPath).post(String.class, applicationFile); | |
} catch (Exception exception) { | |
throw new BuildException(MessageFormat.format("Problem deploying Mule application file {0} to {1}. Exception: {2}", applicationFile, cloudHubUrl, exception.getMessage()), exception, getLocation()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment