Last active
August 29, 2015 14:16
-
-
Save xlcommunity/9af80d5b60149a622062 to your computer and use it in GitHub Desktop.
Import and deploy deployment packages from CLI
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
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR | |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS | |
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS. | |
# requires deployments.py | |
def deployPackage(packagePath, targetEnvironment): | |
print "Importing", packagePath | |
deploymentPackage = deployit.importPackage(packagePath) | |
deploymentPackagePath = deploymentPackage.id.split("/") | |
appName = deploymentPackagePath[len(deploymentPackagePath) - 2] | |
version = deploymentPackagePath[len(deploymentPackagePath) - 1] | |
print "Upgrading application '%s' in environment '%s' to version '%s'" % (appName, targetEnvironment, version) | |
startUpgrade(appName, version, targetEnvironment) | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment