Skip to the content.

IBM UrbanCode PHP CLI Tool - Usage

Run an application process

To simply request an application process, just use the run entry point followed by the path of the file including the information of the application process you want to run. Heres an example of how a JSON file for application process request should look like:

{ application: , applicationProcess: , description: , environment: , onlyChanged: , post-deploy-message: , snapshot: }``

Once you have your JSON file ready, you can request the application process by running

php uCommand.php run application_process.json

This entry point will print in the console the ID and link of the process request:

php uCommand.php run application_process.json

################################## # UrbanCode PHP CLI # # Urban Code Deploy PHP CLI Tool # # by SalesConnectDublin # ##################################

[INFO] Default output to: /home/csitadmin/Documents/uCommand/backups

[ID] 6916dd6f-d061-4c07-9071-2db64bcaaa29 [LINK] https://myUrbanCodeServer:8443/#applicationProcess/6916dd6f-d061-4c07-9071-2db64bcaaa29

Promote a snapshot

The promotion of a snapshot is the process of copying a snapshot from an origin UrbanCode Deploy server to a destination UrbanCode Deploy server, including all component versions and artifacts, specified in the snapshot to be promoted.

Prerequisites In order to successfully promote a snapshot, on the destination UrbanCode Deploy server all the followings are needed:

If any of the cases listed above fails, the promotion of the snapshot wont be able to continue.

Setup configuration for promotion A valid ucd configuration is needed. Please check Required configuration for setting up UrbanCode PHP CLI basic configuration.

Edit your servers.config.php file

vi $uCommand/config/servers.config.php

and fill in the information for the origin and destination server

$config = array();

// Orign server login information $config[origin_weburl] = ; $config[origin_username] = ; $config[origin_password] = ; // DEPRECATED $config[origin_authtoken] = ;

// Destination server login information $config[destination_weburl] = ; $config[destination_username] = ; $config[destination_password] = ; // DEPRECATED $config[destination_authtoken] = ;

// Application name $config[application] = SalesConnect;

// Certificate setup $config[insecure] = true; // Set true for connection without certificate $config[origin_certificate] = ; // Path to certificate for origin server (only if insecure is set to false) $config[destination_certificate] = ; // Path to certificate for destination server (only if insecure is set to false)

For origin and destination server login information, please check Required configuration and the information related to login with tokens (recommended) and login with password.

Run the promotion

cd $uCommand

php uCommand.php promoteSnapshot [snapshot name]

Walkthrough of the promotion process Promotion starts retrieving the snapshot from origin server

UrbanCode PHP CLI will then verify that all prerequisites are in place (list of prerequisites)]

Artifacts are exported from origin server

A new snapshot configuration is set up

Component versions are created. If correctly created, component version will be marked with tag [SUCCESS]; if the component version already exists on destination server, it will be marked with the tag [SKIPPING]. In case of failure, component version will be marked with tag [FAILURE].

If a component version has artifacts, they are uploaded on the destination UrbanCode Deploy server during this process.

User will then be notified of the success or failure. In case of success, a link to the just created snapshot will be displayed in the console.

Promote UrbanCode Deploy configuration

The promotion of UrbanCode Deploy configuration is the process of upgrading UrbanCode Deploy configuration in a destination server using the configuration taken from another UrbanCode Deploy server. This includes upgrade of processes, components and applications.

Promote from UrbanCode Deploy server When promoting the configuration directly from an origin server, UrbanCode PHP CLI is automatically downloading the configuration from the origin server, so to pick up the latest changes. Then it will proceeed to the upgrade process against the destination server.

Edit your servers.config.php file

vi $uCommand/config/servers.config.php

and fill in the information for the origin and destination server. Then run the promotion command:

php uCommand.php promoteConfig

Promote from a source configuration directory When promoting the configuration from a source directoy, UrbanCode PHP CLI is using the configuration saved in the directory to perform an upgrade against the destination server.

Edit your servers.config.php file

vi $uCommand/config/servers.config.php

and fill in the information for the origin and destination server. Then run the promotion command:

php uCommand.php promoteConfig [full_path_for_source_directory]

Promote without importing environments Since the upgrade of application is importing the environments from the orgin server, promoteConfig accepts the argument clean that automatically removes all the new environments imported by the upgrade.

Server to server promotion

php uCommand.php promoteConfig clean

Directory to server promotion

php uCommand.php promoteConfig [full_path_for_source_directory] clean

Perform a restore

php uCommand.php restore path_for_backup_folder

Restore without importing environments

Since the restore of application is importing the environments from the orgin server, restore accepts the argument clean that automatically removes all the new imported environments.

php uCommand.php restore path_for_backup_folder clean

Quick tip:Double check that the configuration file has the correct information of the destination server.

Warning:Please mind that the restore process is returning a false-positive when checking the success of the restore process. Please ignore this message and check for errors in the process output to determine if the restore was successful.

Perform a backup

After setting up the required configuration as described in required configuration, you can either define a directory where to export all the backup files or leave it blank and fall back to the default output directory.

{uCommand_path}``/config/ucd.config.php

$config[output] = ;

Then run the backup:

php uCommand.php backup

Back to …   Latest Version IBM UrbanCode PHP CLI Tool        
All Plugins Deploy Plugins 6.714879 Readme Overview Steps Setup Downloads