# this script is responsible for adding steps to the undeployment plan in case of the undeployment of an xml file

from wlp.modules.utility import Paths
from com.xebialabs.deployit.plugin.api.deployment.specification import Operation
from com.xebialabs.deployit.plugin.api.deployment.planning import DefaultOrders

previousDeployed.location = "%s/%s" % (Paths.get_server_config_dir(
    previousDeployed.container), previousDeployed.name)

context.addStepWithCheckpoint(
    steps.jython(description="Remove configuration entry: %s from: %s" %
                 (previousDeployed.name, previousDeployed.container.name),
                 script="wlp/scripts/resource/destroy-resource.py",
                 order=DefaultOrders.UNDEPLOY_ARTIFACTS), delta,
    Operation.DESTROY)

context.addStepWithCheckpoint(
    steps.delete(description="removing imported xml file: %s from %s" %
                 (previousDeployed.name, previousDeployed.container.name),
                 target_path=previousDeployed.location,
                 order=DefaultOrders.UNDEPLOY_ARTIFACTS + 1), delta,
    Operation.DESTROY)
Beispiel #2
0
#This script adds steps to an undeploy plan to get the ear back into a zipped format
# it only uses one script wich goes into the apps directory and zip up the formerly expanded directory so that xld can then handle the undeploy

from wlp.modules.utility import Paths
from com.xebialabs.deployit.plugin.api.deployment.specification import Operation
from com.xebialabs.deployit.plugin.api.deployment.planning import DefaultOrders


if previousDeployed.unpackZipFile is True:

    fc = {'previousDeployed': previousDeployed,
          'targetPath': "%s/apps" % (Paths.get_server_config_dir(previousDeployed.container))}

    context.addStepWithCheckpoint(steps.os_script(
        description="repacking earfile: %s " % (previousDeployed.name) ,
        script="lmwlp/scripts/application/pack-ear",
        freemarker_context=fc,
        order=DefaultOrders.UNDEPLOY_ARTIFACTS - 1 ,
        target_host = previousDeployed.container.host
    ), delta, Operation.DESTROY)
# this script is responsible for adding steps to the undeployment plan in case of the undeployment of an xml file

from wlp.modules.utility import Paths
from com.xebialabs.deployit.plugin.api.deployment.specification import Operation
from com.xebialabs.deployit.plugin.api.deployment.planning import DefaultOrders

location = "%s/%s" % (Paths.get_server_config_dir(previousDeployed.container),  previousDeployed.name)

context.addStepWithCheckpoint(steps.delete(
    description="removing config file: %s from %s" % (previousDeployed.name, previousDeployed.container.name),
    target_path=location
), delta, Operation.DESTROY)
Beispiel #4
0
# this script is responsible for adding steps to the deployment plan in case of the deployment of an xml file

from wlp.modules.utility import Paths
from com.xebialabs.deployit.plugin.api.deployment.specification import Operation
from com.xebialabs.deployit.plugin.api.deployment.planning import DefaultOrders

deployed.location = "%s/%s" % (Paths.get_server_config_dir(
    deployed.container), deployed.name)

context.addStepWithCheckpoint(
    steps.upload(description="Upload xml '%s' to server '%s'" %
                 (deployed.name, deployed.container.name),
                 target_path=deployed.location,
                 order=DefaultOrders.DEPLOY_ARTIFACTS + deployed.rank), delta,
    Operation.CREATE)

context.addStepWithCheckpoint(
    steps.jython(description="Create '%s' xml entry on server '%s'" %
                 (deployed.name, deployed.container.name),
                 script="wlp/scripts/resource/create-modify-resource.py",
                 order=DefaultOrders.DEPLOY_ARTIFACTS + 1 + deployed.rank),
    delta, Operation.CREATE)
# this script is responsible for adding steps to the deployment plan in case of the deployment of an xml file

from wlp.modules.utility import Paths
from com.xebialabs.deployit.plugin.api.deployment.specification import Operation
from com.xebialabs.deployit.plugin.api.deployment.planning import DefaultOrders


location = "%s/%s" % (Paths.get_server_config_dir(deployed.container),  deployed.name)
logger.info("location for config file is %s" % location)
context.addStepWithCheckpoint(steps.upload(
    description="Upload config file '%s' to server '%s'" % (deployed.name, deployed.container.name),
    target_path=location
), delta, Operation.CREATE)
Beispiel #6
0
# this script will add three steps to a plan for each module being deployed to targetPath
# step 1: unpack ear : this will unpack a already deployed earfile in place in the apps directory of webshpere liberty profile
# step 2: unpack war : this will unpack all war files found inside the unpacked earfile
# step 4: update application.xml. this will augment the appliction.xml with the new paths inside the ear after war unpack
#
#These steps will be added for each

from wlp.modules.utility import Paths
from com.xebialabs.deployit.plugin.api.deployment.specification import Operation
from com.xebialabs.deployit.plugin.api.deployment.planning import DefaultOrders

if deployed.unpackZipFile is True:
    fc = {
        'deployed': deployed,
        'targetPath':
        "%s/apps" % (Paths.get_server_config_dir(deployed.container))
    }
    context.addStepWithCheckpoint(
        steps.os_script(description="unpacking earfile: %s " % (deployed.name),
                        script="lmwlp/scripts/application/unpack-ear",
                        freemarker_context=fc,
                        order=DefaultOrders.DEPLOY_ARTIFACTS + 4,
                        target_host=deployed.container.host), delta,
        Operation.CREATE)
    context.addStepWithCheckpoint(
        steps.os_script(description="unpacking warfiles for application: %s " %
                        (deployed.name),
                        script="lmwlp/scripts/application/unpack-war",
                        freemarker_context=fc,
                        order=DefaultOrders.DEPLOY_ARTIFACTS + 5,
                        target_host=deployed.container.host), delta,