Contents


Perform complex tasks with uCommand

Using the UrbanCode Deploy PHP CLI tool

Comments

uCommand is a CLI tool that provides easy-to-use functionalities to work with IBM® UrbanCode Deploy. You can download uCommand from the plug-in section of the UrbanCode Developer Center.

When using UrbanCode Deploy, most of your interaction is through the web interface. To integrate UrbanCode into a wider pipeline structure where everything is connected and automated you need a reliable way to perform actions through CLI.

UrbanCode Deploy comes with an official CLI tool (udclient). But, udclient lacks important functionality, such as the possibility to backup, restore, and upgrade the UrbanCode configuration or request an application process that is waiting for completion.

uCommand aims to fill these gaps. It provides simple actions for predefined functions and also a PHP implementation for most of the UrbanCode Deploy APIs. It is easy to setup and use. uCommand requires the web URL, username, and authtoken for the UrbanCode server. A setup wizard helps you configure the tool on the first start, including the creation of the authorization token for a secure connection to the server.

Functionality

Some advantages of uCommand include:

  • Ease of use
  • Developer ready
  • Commonly used actions provided
  • Easy to automate UrbanCode Deploy tasks

Because the tool is built on top of the UrbanCode Deploy udclient and REST APIs, you don't need to run numerous commands just to perform a particular action.

For example, to manually backup the UrbanCode Deploy configuration using udclient and REST APIs:

  1. Find all of the components, processes, and resources that make up each application.
  2. Backup each of the individual items before backing up the application itself.

With uCommand, these manual steps are combined together. To perform a complete backup, you don't need to know the relationship between each element of the configuration; just run a single command:

php ucommand.php backup

With uCommand you can:

  • Back up your server configuration.
  • Restore the server configuration to a server at the same IBM UrbanCode Deploy release version.
  • Share an UrbanCode Deploy configuration between multiple UrbanCode Deploy servers.
  • Create versions for components which contain the deployable artifacts.
  • Bundle a collection of versions together into a snapshot that can be deployed together.
  • Promote a snapshot from one server to another server.
  • Run deployment processes.

This article uses a simple UrbanCode Deploy application with related components and processes:

  • Name: LAMP
  • Description: Application to deploy a LAMP server
  • Components:
    • Apache
    • MySQL
    • PHP
  • Processes: Deploy

Backup and restore UrbanCode Deploy configuration

By default, UrbanCode Deploy doesn't provide a tool to back up and restore its entire configuration. However, uCommand provides simple actions to run these tasks:

php ucommand.php --action=backup
php ucommand.php --action=restore --dir={{backup_directory}}

Share configuration and artifacts

uCommand is designed to work with one or more UrbanCode Deploy servers. The files exported during the backup can be restored in the same UrbanCode Deploy server. These can also be easily shared with other UrbanCode Deploy servers at the same time.

uCommand lets you share your data with other teams, from the single component to the entire configuration or even a snapshot and its dependencies (artifacts files).

It's also possible to replicate the exact configuration and data into multiple servers to perform the exact same deployment as the source server. Here's an example:

Using uCommand to share configuration and artifacts

To share an application from one UrbanCode origin server to a destination server:

php ucommand.php
  --action=promoteApplication
  --application{{application_name}}

To share a snapshot, including its artifacts:

php ucommand.php
  --action=promoteSnapshot
  --snapshot={{snapshot_name}}

Run an application process

UrbanCode Deploy is used primarily through the web interface. However, there are cases when the deployment should be automated or run within a script, for example when UrbanCode Deploy needs to run automatically within a deployment automation pipeline or from a server CLI that doesn't provide a user interface.

With uCommand you can run an application process with parameters (application name, process name, properties, etc.). uCommand also provides an easy to use action to request the execution of an application process and wait for its completion. It returns the success or failure of the deployment upon completion:

php ucommand.php
  --action=runAndWait
  --file={{request_json_file}}

Where the request JSON file contains the following information:

{
    "application": "APPLICATION_NAME",
    "applicationProcess": "APPLICATION_PROCESS",
    "description": "GENERIC_DESCRIPTION",
    "environment": "ENVIRONMENT_TO_DEPLOY",
    "onlyChanged": "APPLY_CHANGED_VERSIONS_ONLY",
    "post-deploy-message": "MESSAGE_POST_DEPLOYMENT",
    "snapshot": "SNAPSHOT_NAME"
}

You can use uCommand as a CLI tool to run deployments from your Continuous Integration/Continuous Delivery (CI/CD) pipeline.

Setup uCommand

uCommand uses a wrapper script written in PHP that combines udclient and REST APIs so that the user can perform everyday actions. The tool first generates the API request, combining login information (web URL, username, authtoken) with the action to execute and the related parameters. The generated request is then executed in the CLI through the PHP exec function.

uCommand not only provides a PHP layer for the available UrbanCode APIs, but also combines them to create more complex functions. This means that, for some actions, more than one API is called in sequence and results are combined together.

ucommand.php

ucommand.php is the executable PHP script that triggers the numerous actions available in the tool for either retrieving or creating data in UrbanCode Deploy.

It takes care of:

  • Object instances
  • Configuration setup
  • Argument validation
  • Execute action
  • Help

A list of available actions that uCommand can execute are provided in the Actions section.

Configuring uCommand

uCommand comes with a set of default settings, though some server-specific values are required for the proper execution of the tool. The configuration files are in the config subdirectory of the tool.

Setup wizard

A setup script is available to help you with the uCommand configuration. Run the setup script from the uCommand home directory:

cd {{ucommand_directory}}
php ucommand.php --action=setup

You are guided through a set of configuration steps, including the request of an authtoken for a secure connection to UrbanCode Deploy server. The setup also checks that all the prerequisites are met to run uCommand correctly.

The setup script generates a server configuration file in the config/servers/ folder. The file is named after the alias you provided:

alias: '{{my_server}}'
file: '{{my_server}}.server.php'

It's possible to save more than one server configuration and then choose which one to use.

To choose a server configuration to use with uCommand:

php ucommand.php
  --action=config
  --alias={{alias_name}}

Running uCommand

To work properly, uCommand requires:

  • PHP 5.4+
  • Java 1.6.0+
  • Read, write, and execute permission on the entire uCommand folder
  • A valid configuration

To execute any action, run this command after everything is set up:

cd {{UCOMMAND_DIRECTORY}}
php ucommand.php
  --action={{ACTION}}
  --{{argument_2}}={{VALUE_2}}
  ...

The result for the action is an output either in the CLI or in a file. This is based on the type of output set in the configuration file. Log information with feedback is also available for each action. This information includes a notification of the success or failure of an operation.

Actions

There are numerous actions available for uCommand. To request an action:

php ucommand.php
  --action={{ACTION}}
  --{{argument_1}}={{VALUE_1}}
  --{{argument_2}}={{VALUE_2}}
  ...

Note: The order in which the arguments are specified is irrelevant to the correct execution of the action.

For each supported action uCommand provides online help with details on using the tool. To get help for a specific action:

php ucommand.php
  --action={{ACTION}}
  --help

Application process actions

ActionDetails
requestStatusReturns the current status of a requested process
Required: --processID of process request

When an application process request ID is passed as an argument, the status of the process is returned:

  • 0 - Completed with success
  • 2 - Initialized
  • 3 - Executing
  • 4 - Pending
  • 5 – Cancelled
  • 100 - Agent not online
  • 255 - Completed with failure

The application process request ID can be taken from the UrbanCode Deploy URL in the web browser.

{{SERVER_URL}}/#applicationProcessRequest/82d6119e-b9fd-4396-9cee-7cc484be4d77

Or, the ID can be taken from the CLI output of the uCommand action run.

ActionDetails
runRequests an application process according to the details set in the JSON file passed as argument
Required: --filePath to application process request JSON file

Run an application process, defined in a JSON file as follows:

{
 "application": {{APPLICATION_NAME}},
   	"applicationProcess": {{APPLICATION_PROCESS}},
   	"description": {{GENERIC_DESCRIPTION}},
   	"environment": {{ENVIRONMENT_TO_DEPLOY}},
   	"onlyChanged": {{APPLY_CHANGED_VERSIONS_ONLY}},
   	"post-deploy-message": {{MESSAGE_POST_DEPLOYMENT}},
   	"snapshot": {{SNAPSHOT_NAME}},
 "properties" : {
    {{PROPERTY}} : {{VALUE}}
  }
}

If the application process requires one or more properties to run, these can be listed and defined in the properties value in the JSON file.

ActionDetails
runAndWait Requests an application process according to the details set in the JSON file passed as argument. Polls the request until it's completed. Returns completion status.
Required: --filePath to application process request JSON file

Combines the actions run and requestStatus. When a JSON file is passed, an application process is requested (as defined by the run action) and waits for its completion.

The runAndWait action prints in the console each change of status for the application process request (for example, from PENDING to EXECUTING to CLOSED). The runAndWait action exits when the process completes (exit code 0, 5, 255) or the agents are not online (exit code 100).

ActionDetails
waitRequestCompletion Polls the request until it's completed and returns completion status.
Required: --processID of process request
Optional: --timeoutTimeout in minutes

Wait for an application process to complete, then exit with the result of the process. For the list of exit codes, refer to the requestStatus table.

UrbanCode configuration actions

ActionDetails
addVersionFilesAdd files to a component version.
Required:

--component

--version

--base

Component name

Component version name

Base directory for files to be uploaded

Optional:

--include

--exclude

Comma separated list of files to include in the upload

Comma separated list of files to exclude in the upload. This has precedence over the include.

ActionDetails
backupRun a complete back up of UrbanCode Deploy.
Backup output is a list of JSON files saved in a well structured folder.

Backup does not require any specific configuration. The exported JSON files are saved into the output folder defined in the ucd.config.php configuration file. The structure for the output folder is:

OUTPUT_FOLDER

  • applications
    • APPLICATION _NAME
      • components
      • APPLICATION_NAME.json
  • blueprints
  • components
  • componentTemplates
  • processes
  • resources
  • resourceTemplates
  • settings
ActionDetails
cleanAllClean UrbanCode Deploy server from unused data that matches a particular pattern defined in configuration file clean.config.php.

After configuring the clean.config.php file (see the Appendix for an example), cleanAll takes the rules defined in this file and verifies which element of the UrbanCode Deploy configuration matches the rules.

In particular, cleanAll verifies if the name of an element of the UrbanCode Deploy configuration contains a particular pattern that is defined in the include section of the config file. If an element name matches the pattern, it is removed.

The exclude rules have precedence over the include rules. For example, if an element is matched by both the include and exclude rules, it is not cleaned from the server.

For example, configuration (extract):

$config['include']['component'] = ".DEV";
$config['exclude']['component'] = ".TEST";
$config['include']['application'] = ".APP";
Component nameAfter cleanAll
DeployPHP.DEVREMOVED (matches ".DEV")
DeployPHP.APPNOT REMOVED (".APP" refers to application only)
DeployPHP.DEV.TESTNOT REMOVED (matches exclusion ".TEST")
DeployPHPDEVNOT REMOVED (pattern not matched)

When no rule has been defined for the specific configuration element, define a default rule for both include and exclude:

$config['include']['default']
$config['exclude']['default']

The position parameter defines where the given pattern should be placed so to be considered matched.

The position values are:

  • start: The pattern is at the beginning of the name
  • end: The pattern is at the end of the name
  • empty: The pattern is anywhere in the name

Examples of configuration (extract) are:

$config['include']['component'] = ".DEV";
$config['exclude']['component'] = ".TEST";
$config['include']['position'] = "end";
$config['exclude']['position'] = "";
Component NameAfter cleanAll
DeployPHP.DEVREMOVED (matches ".DEV" at the end of the name)
DeployPHP.DEV.DeployNOT REMOVED (".DEV" is not at the end of the name)
DeployPHP.TEST.DEVNOT REMOVED (even if ".DEV" is at the end of the name, it matches exclusion ".TEST", which can be anywhere in the name)
DeployPHP.DEV.TESTNOT REMOVED (matches exclusion ".TEST" and ".DEV" is not at the end of the name)
ActionDetails
forkApplicationFork an existing application to create a new copy with a different suffix.
Required:

--application

--old

--new


Application name or ID

Old application suffix

New application suffix

To fork an application, duplicate the exact same application into the same UrbanCode Deploy server. Add a new suffix to the end of the application name and component names.

This might be useful in scenarios where, due to development reasons, it's necessary to develop new functionality for UrbanCode Deploy without risking breaking a working configuration set.

The action forkApplication takes an application name and the old suffix that defines it and its related components and generic processes, then creates the exact copy of these. The old suffix is replaced with the new one.

For example, using the following application:

  • Application Name: LAMP_v1
  • Components:
    • Apache_v1
    • MySQL_v1
    • PHP_v1
  • Generic Process: Deploy_v1

Run the command:

php ucommand.php
  --action=forkApplication
  --application=LAMP_v1
  --old="_v1"
  --new="_v2"

Results in the creation of:

  • Application name: LAMP_v2
  • Components:
    • Apache_v2
    • MySQL_v2
    • PHP_v2
  • Generic process: Deploy_v2
ActionDetails
restoreRun a complete restore of UrbanCode Deploy from a structured folder. The folder structure is the same as generated by backup process.
Required: --dirSource path for restore
Optional: --environmentsIf set to 'true', import the environments that come with the applications.

The restore action recreates the UrbanCode Deploy configuration that has been exported from a first UrbanCode Deploy server into a second one, taking as argument a folder, structured as defined by the backup action.

Running the restore action against a clean and empty UrbanCode Deploy server is recommended. If you don't you might incur unexpected results.

Use the promoteConfig or promoteApplication actions to import a configuration into an UrbanCode Deploy server that is not empty.

ActionDetails
restoreApplicationRestore an application from a JSON file or an application and its components from a folder.
Required: --filePath to the application JSON file or path to an application folder.

The application JSON file should be the one provided by the backup action. This is the same file generated by the export button from the UrbanCode Deploy web UI.

Running the restore action against an UrbanCode Deploy server that already contains the application that you're trying to import is not recommended; use the promoteApplication action instead.

ActionDetails
restoreComponentRestore a component from a JSON file, creating it.
Required: --filePath to component JSON file.

Component JSON file should be the one provided by the backup action. This is the same file generated by the export button from the UrbanCode Deploy web UI.

Running the restore action against an UrbanCode Deploy server that already contains the application that you're trying to import is not recommended; use the promoteConfig or promoteApplication actions instead.

ActionDetails
restoreComponentTemplateRestore a component template from a JSON file, creating it.
Required: --filePath to component template JSON file.

The component template JSON file should be the file provided by the backup action, which is the same file generated by the export button from the UrbanCode Deploy web UI.

ActionDetails
upgradeApplicationUpgrade an existing application from a JSON file or an application and its components from a folder. Creates the application (and relative components) if missing in target UrbanCode Deploy server.
Required: --filePath to application JSON file or application folder.

Application JSON file should be the one provided by the backup action, which is the same file generated by the export button from the UrbanCode Deploy web UI. The upgrade includes the environments, but not the resource templates and the blueprints.

ActionDetails
upgradeComponentUpgrade an existing component from a JSON file. Creates the component if missing in target UrbanCode Deploy server.
Required: --filePath to component JSON file.

Component JSON file should be the one provided by the backup action, which is the same file generated by the export button from the UrbanCode Deploy web UI.

ActionDetails
upgradeComponentTemplateUpgrade a component template from a JSON file. The component template is created if it isn't in the target UrbanCode Deploy server.
Required: --filePath to component template JSON file.

The component template JSON file should be the file provided by the backup action, which is the same file generated by the export button from the UrbanCode Deploy web UI.

Environment actions

ActionDetails
createEnvironmentCreate a new environment based on the content of the JSON file passed as argument.
Required: --filePath to the JSON file describing the details of the environment to create.

Environment JSON file should be structured as defined in Template for environment creation.

The createEnvironment action will fail if one of the following occurs:

  • Application doesn't exist
  • Environment name already exists
  • Blueprint doesn't exit
  • Base resource doesn't exist
ActionDetails
exportEnvironmentPropertiesExports environment properties and saves them into a JSON file.
Required: --environmentEnvironment ID or name
Optional: --applicationApplication ID or name

When passing an environment ID as an argument, uCommand exports the environment properties into a JSON file. If an environment name is passed, the application name is also required. Properties are combined into one file if the same value is used by multiple components. If a property is set to be secure, the value is exported as four stars ( **** ) to avoid password exposure. For example:

{
"propertyName":"PROPERTY_NAME",
"value":"PROPERTY_VALUE",
"secure":false,
"components":[
"COMPONENT_1",
"COMPONENT_2",
"COMPONENT_3"
]
},
{
"propertyName":"PROPERTY_NAME",
"value":"****",
"secure":true,
"components":[
"COMPONENT_1"
]
},
ActionDetails
importEnvironmentPropertiesImport environment properties from an exported JSON file into an existing environment.
Required:

--file

--environment


Path of the JSON file exported with the exportEnvironmentProperties

Environment ID or name

When passing an environment ID as an argument, uCommand imports the environment properties into a JSON file. If an environment name is passed, the application name is also required. The JSON file should be structured as defined in the action exportEnvironmentProperties. It is possible to set any of the property values, one for each component or one for a batch of components.

If a secure property value is set to **** (masked secure value), uCommand can't import it and will abort the action, prompting the user for action. To import a secure property value, the user needs to manually set it into the JSON file.

Warning: Any secure property value (such as passwords) manually set in the JSON file are exposed as plain text. After imported, UrbanCode Deploy encrypts these values, hiding them from the web UI. We recommended that you clean the JSON file after import to avoid any data breach.

Promotion actions

Promotion actions require a valid promote.config.php file:

php ucommand.php
  --action=config
  --origin={{ORIGIN_ALIAS}}
  --destination={{DESTINATION_ALIAS}}

Aliases are used as defined in Setup uCommand.

Valid configurations are required for both aliases and should be available in the /config/servers folder.

ActionDetails
promoteApplicationPromote an application from one UrbanCode Deploy server to a second one.
Required: --applicationApplication name or ID

When an application name is passed as an argument, uCommand verifies that the application is available from the origin server, exports the application, and imports it into the destination server.

If the application is missing in the destination UrbanCode Deploy server, the application is created; otherwise, the existing application is upgraded.

The promoteApplication action imports or upgrades all the components, component templates, processes, resource templates and blueprints that come with the application. Environments won't be imported.

ActionDetails
promoteConfigPromote the entire UrbanCode Deploy configuration from one server to a second one. If the optional parameter is set to clean, the environment is not imported.
Optional:

--dir

--environments


If a directory is provided, restore configuration from there.

If set to true, import environments that come with the applications.

The promoteConfig action downloads the entire UrbanCode Deploy configuration from the origin server (as done by backup action). The configuration is then imported into the destination server. It covers the promotion of:

  • Applications
  • Components
  • Resource templates
  • Processes
  • Environments (unless the clean parameter is set)

Missing elements are created. Existing elements are upgraded.

ActionDetails
promoteResourceTemplatePromote a resource template give its name or ID.
Required: --templateResource template name or ID

When a resource template name or ID is passed as an argument, uCommand exports a resource template from the origin server and imports the resource template into the destination server.

If the resource template doesn't exist in the destination server it will be created; otherwise it is upgraded to reflect the same structure from the original server.

ActionDetails
promoteSnapshotPromotes a snapshot from one UrbanCode Deploy server to a second one, based on the details set in the configuration file. Component version creation is included here.
Required: --snapshotSnapshot name
Optional: --forceIf set to true it will force the creation of the snapshot even if all the component versions already exist.

When there are two UrbanCode Deploy servers with the same application available on both, uCommand can:

  • Check to see if the application, defined in the server configuration files for the aliases set in promote.config.php, exists in both servers
  • Check if all the required components are available in destination server
  • Check if the snapshot is not already available in the destination server
  • Export the snapshot from the origin server, including the artifacts
  • Create the component versions listed in the snapshot in the destination server
  • Upload all the artifacts associated to the component versions
  • Create the snapshot in the destination server

The snapshot won't be created if all component versions already exist in the destination server, unless you set the parameter force.

Snapshot and versioning actions

ActionDetails
createSnapshotCreate a snapshot based on a JSON file.
The JSON file should include information about snapshot name, application, and list of component versions.
Required: --snapshotSnapshot JSON file

The createSnapshot action creates a snapshot based on the description defined in the JSON file passed as argument. See the Appendix for the required JSON file example.

If the component versions listed in the JSON file are missing from the UrbanCode Deploy server, the snapshot creation fails.

ActionDetails
createVersionCreate a new component version.
Required:

--component

--version


Component name or component ID

Version Name

Optional: --descriptionVersion description

The createVersion action creates a component version given the component name and the version name. If the version already exists, the action fails.

Note: This API doesn't add files (artifacts) to the version.

ActionDetails
createVersionAddFilesCreate a new component version and add artifacts files.
Required:

--component

--version

--base


Component name

Component version name

Base directory for files to be uploaded

Optional:

--include

--exclude


Comma separated list of files to include in the upload

Comma separated list of files to exclude in the upload. This has precedence over the include.

Combines the action createVersion with the action addVersionFiles. When a component name, a version, and the base directory are passed as arguments, a new component version is created and the included artifacts are attached into the base directory. Using include and exclude options, it is possible to filter the files to be uploaded to the version.

ActionDetails
cGet a PHP or JSON file which includes the snapshot configuration. Gets the component versions listed and creates them. After that, it creates the snapshot. This also adds files (artifacts) to the component versions created.
Required: --fileSnapshot configuration file (PHP or JSON)

Combines the actions createSnapshot and createVersion. When passed as an argument, a snapshot JSON file (as defined in the Appendix) creates the missing component versions, uploads artifacts and creates the snapshot.

Note: The creation fails if all the component versions or the snapshot already exist.

ActionDetails
setSnapshotStatusSet a snapshot status. Status can be either PASSED or FAILED.
Required:

--snapshot

--status


Snapshot Name

Snapshot Status: Passed | Failed

The setSnapshotStatus action sets a snapshot as PASSED or FAILED. This means that the snapshot is renamed according to the status that has been passed as an argument, for example:

php ucommand.php
  --action=setSnapshotStatus
  --snapshot="TestSnapshot"
  --status="PASSED"

Results in the snapshot being renamed to TestSnapshot_PASSED.

If a snapshot is already set, the setSnapshotStatus action accepts the snapshot name with or without the status, for example:

php ucommand.php
  --action=setSnapshotStatus
  --snapshot="TestSnapshot_FAILED"
  --status="PASSED"

And:

php ucommand.php
  --action=setSnapshotStatus
  --snapshot="TestSnapshot"
  --status="PASSED"

Are both successful and result in the snapshot TestSnapshot_PASSED.

Miscellaneous actions

This section is a list of actions that do not fall into any of the categories already discussed in this article.

To create teams, click Security > Teams on the UrbanCode Deploy settings page.

Use addTeamToComponent to associate a team to a component. If a name or ID is not specified, all available components are added.

ActionDetails
addTeamToComponentAdd a component to a team. If the component name/ID is not passed as an argument, all the components available in UrbanCode Deploy are added to the team.
Required: --teamTeam name or ID
Optional: --componentComponent name or ID

Use addTeamToResource to associate a team to a particular resource. If a resource name/ID is not set the team is associated to all resources available in UrbanCode Deploy.

ActionDetails
addTeamToResourceAdd a resource to a team. If the resource is not passed as argument, all the resources available in UrbanCode Deploy is added to the team.
Required: --teamTeam name or ID
Optional: --resourceResource name or ID

addTeamToAll applies to these elements:

  • Agents
  • Agent pools
  • Applications
  • Cloud connections
  • Components
  • Component templates
  • Environments
  • Processes
  • Resources
  • Resource templates
ActionDetails
addTeamToAllAssign a team to the entire UrbanCode Deploy configuration.
Required: --teamTeam name or ID

With config, it's possible to set each alias to use in uCommand for default actions (alias), and for promotion actions (destination and origin). You can set one or more of these at the same time. A valid alias is required.

ActionDetails
configConfigure alias to be used in uCommand.
Optional:

--alias

--destination

--origin


Alias name to use as default

Alias name to use as destination

Alias name to use as origin


ActionDetails
verPrints information about the uCommand and supported UrbanCode Deploy versions.

Conclusion

In this article you learned how to retrieve, configure, and use uCommand as a command line tool to perform actions on UrbanCode Deploy. With the detailed API provided, you learned how to do the basic tasks, and manage complex sets of tasks using UrbanCode Deploy servers. With this knowledge, you can work from both the command line terminal and from the web UI. uCommand gives you flexibility to perform complex tasks with one command. With uCommand you can easily copy data between servers and quickly share existing applications with others.

Appendix

Find examples, templates, and upgrade values.

Example for ucd.config.php

<?php
// Urban Code Deploy settings
$config['alias'] = 'template';

// Path where Urban Code Deploy client is saved
$config['udcpath'] = '';

/* * Path where to save the results* If NOT Set, will be defaulted to: %path_to_current_working_directory%/backups/
$config['output'] = '';

// Path for JAVA HOME
$config['java_home'] = '/usr/lib/j2sdk1.6-ibm/';

// Silent mode for outputs
$config['silent'] = false;

// Run a scan of exported files and verify that are valid JSON
$config['json_check'] = false;

// CURL settings for secure connection
$config['insecure'] = true;
$config['certificate'] = '';

/* * Implement Component::Process Steps - Impersonation * Impersonation actions configuration is set up in: /udclient/config/ucd.impersonation.config.php */
$config['apply_impersonation'] = false;
?>

Example for template.server.php config file

<?php
$config = array (
    'alias' => 'template',
    'weburl' => 'https://myucdserver.example.com:8443',
    'username' => 'username@email.com',
    'authtoken' => 'abcd1234-abcd-1234-abcd-abcd12345678',
    'application' => 'MyApplication',
    'environment' => 'MyEnvironment'

);

Example for promote.config.php

<?php
$config = array();
$config['origin_alias'] = 'ALIAS_NAME';
$config['destination_alias'] = 'ALIAS_NAME';

Example for environment properties file

[
  {
    "propertyName":"Property_Name",
    "value":"Property_Value",
    "secure":false,
    "components":[
      "Component_Name"
	]
  },
  {
    "propertyName":"Property_Name_Multiple_Components",
    "value":"Property_Value",
    "secure":false,
    "components":[
      "Component_Name_1",
      "Component_Name_2"
    ]
  },
  {
    "propertyName":"Property_Name_Secure",
    "value":"****",
    "secure":true,
    "components":[
      "Component_Name_1",
      "Component_Name_2"
    ]
  }]

Example for Snapshot creation

Required content for $snapshot as array:

$snapshot [ 'snapshot' ] [ 'name' ] = SNAPSHOT_NAME
$snapshot [ 'application' ] = APPLICATION_NAME
$snapshot [ 'snapshot' ] [ 'description' ] = SNAPSHOT_DESCRITPTION
$snapshot [ 'components' ] = array ( COMPONENT => VERSION )
$snapshot [ 'artifacts' ] = array ( 
COMPONENT => array (
'base' = BASE_DIRECTORY,
'include' = array ( INCLUDED_FILES_AND_DIRECTORIES ),
'exclude' = array ( EXCLUDED_FILES_AND_DIRECTORIES )
)
)

Required content for $snapshot as JSON file

{ 
"snapshot" : {
	"name" : SNAPSHOT_NAME ,
	"description" : SNAPSHOT_DESCRIPTION
},
 	"application" : APPLICATION_NAME ,
	"components" : {
	COMPONENT : VERSION ,
	COMPONENT : VERSION ,
},
"artifacts" : [
{ COMPONENT : {
'base' : BASE_DIRECTORY,
'include' : { INCLUDED_FILES_AND_DIRECTORIES },
'exclude' : { EXCLUDED_FILES_AND_DIRECTORIES }
}
]

}

Example clean.config.php

/* Include in clean */
$config['clean']['include']['rule'] = 
array(
'default' => '.DEV',
'application' => '',
'component' => '',
'applicationProcess' => '',
'componentProcess' => '',
'genericProcess' => '',
'postProcessScript' => ''
);
$config['clean']['include']['position'] = '';

/* Exclude from clean */
$config['clean']['exclude']['rule'] = 
array(
'default' => '.DEV',
'application' => '',
'component' => '',
'applicationProcess' => '',
'componentProcess' => '',
'genericProcess' => '',
'postProcessScript' => ''
);
$config['clean']['exclude']['position'] = '';

Template for environment creation

{
    "application":"Your_Application_Name",
    "baseResource":"Path_For_Base_Resource",
    "blueprint":"Your_Application_Blueprint_Name",
    "name":"Your_Environment_Name"
 }

Upgrade values

ValueAction
USE_EXISTING_IF_EXISTS If the template/process already exists, use the one in the UrbanCode Deploy server.
CREATE_NEW_IF_EXISTS If the template/process already exists, create a new one based on the template/process stored in the component passed as argument.
FAIL_IF_EXISTS If the template/process already exists, fail the upgrade process.
FAIL_IF_DOESNT_EXIST If the template/process does not exist, fail the upgrade process.
UPGRADE_IF_EXISTS If the template/process already exists, upgrade it with the template/process stored in the component passed as argument.

Downloadable resources


Related topics


Comments

Sign in or register to add and subscribe to comments.

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=DevOps
ArticleID=1020973
ArticleTitle=Perform complex tasks with uCommand
publish-date=11172015