#
# 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.
#

from xldeploy.XLDeployClientUtil import XLDeployClientUtil

def createPath(path):
    parent = path.rpartition('/')[0]
    if not xldDestinationClient.check_CI_exist(parent):
        createPath(parent)
    xldDestinationClient.create_directory(path)

xldSourceClient = XLDeployClientUtil.createXLDeployClient(xldeployServer, username, password)
xldDestinationClient = XLDeployClientUtil.createXLDeployClient(destinationXLDeployServer, destinationUsername, destinationPassword)

if autoCreatePath:
    appPath = deploymentPackage.rpartition('/')[0]
    if not xldDestinationClient.check_CI_exist(appPath):
        parent = appPath.rpartition('/')[0]
        if not xldDestinationClient.check_CI_exist(parent):
            createPath(parent)
        xldDestinationClient.create_application(appPath)

packageUUID = xldSourceClient.get_download_uuid(deploymentPackage)
fetchURL = xldeployServer['url'] + '/deployit/internal/download/' + packageUUID
print(fetchURL)
xldDestinationClient.fetch_package(fetchURL)

# 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.
#

from xldeploy.XLDeployClientUtil import XLDeployClientUtil


xld_client = XLDeployClientUtil.createXLDeployClient(xldeployServer, username, password)

applicationId = xld_client.get_latest_deployed_version(environmentId, applicationName)

Exemplo n.º 3
0
import sys
from xldeploy.XLDeployClientUtil import XLDeployClientUtil

print "cloud::UnkinkConfiguration"
parameters = "{}"
print "Parameters %s " % parameters
xldClient = XLDeployClientUtil.createXLDeployClient(xldeployServer, username,
                                                    password)

print 'DEBUG: About to prepare %s on %s\n' % (controlTaskName, ciId)
task_id = xldClient.prepare_control_task(controlTaskName, ciId, parameters)
print 'DEBUG: About to invoke task and wait for response', task_id, '\n'
task_state = xldClient.invoke_task_and_wait_for_result(
    task_id, pollingInterval, numberOfPollingTrials, continueIfStepFails,
    numberOfContinueRetrials)
print 'DEBUG: Task state for', task_id, ':', task_state, '\n'
xldClient.archiveTask(task_id)
if task_state in ('DONE', 'EXECUTED'):
    sys.exit(0)
sys.exit(1)
Exemplo n.º 4
0
# 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.
#

from xldeploy.XLDeployClientUtil import XLDeployClientUtil


def createPath(path):
    parent = path.rpartition('/')[0]
    if not xldDestinationClient.check_CI_exist(parent):
        createPath(parent)
    xldDestinationClient.create_directory(path)


xldSourceClient = XLDeployClientUtil.createXLDeployClient(
    xldeployServer, username, password)
xldDestinationClient = XLDeployClientUtil.createXLDeployClient(
    destinationXLDeployServer, destinationUsername, destinationPassword)

if autoCreatePath:
    appPath = deploymentPackage.rpartition('/')[0]
    if not xldDestinationClient.check_CI_exist(appPath):
        parent = appPath.rpartition('/')[0]
        if not xldDestinationClient.check_CI_exist(parent):
            createPath(parent)
        xldDestinationClient.create_application(appPath)

packageUUID = xldSourceClient.get_download_uuid(deploymentPackage)
fetchURL = xldeployServer['url'] + '/deployit/internal/download/' + packageUUID
print(fetchURL)
xldDestinationClient.fetch_package(fetchURL)