It turns out, the Jenkins pipeline for this is just like deploy pipeline.
For this example, my custom UCDeploy application is called "my-custom-app", the environment is "staging", the process is "glFetch". That process takes two arguments, appShort and assetId. My UCD site is named: "my site". Here is a partial pipeline:
pipeline {
parameters {
string(name: 'appShort')
string(name: 'assetId')
}
environment {
appShort = "${params.appShort}"
assetId = "${params.assetId}"
}
stages {
stage ('Run UCD') {
steps {
step([
$class: 'UCDeployPublisher',
siteName: 'my site',
deploy: [
$class: 'com.urbancode.jenkins.plugins.ucdeploy.DeployHelper$DeployBlock',
deployApp: 'my-custom-app',
deployEnv: 'staging',
deployProc: 'gitFetch',
deployReqProps: "appShort=${appShort}\nassetId=${assetId}"
]
])
}
}
}
}
------------------------------
Kevin Buchs
------------------------------
Original Message:
Sent: Mon July 11, 2022 12:33 PM
From: Kevin Buchs
Subject: Urban Code Deploy - calling a custom application/process from Jenkins
I need to create a Jenkins pipeline which can invoke a custom application created in UCDeploy. This application is not a routine deployment operation. I can find abundant examples of Jenkins pipeline code which can upload and deploy artifacts and software. Code like this:
step([ $class: 'UCDeployPublisher', siteName: "${siteName}", deploy: [ $class: 'com.urbancode.jenkins.plugins.ucdeploy.DeployHelper$DeployBlock', deployApp: "${app}", ...
I have references to a GitHub repo for the Jenkins plugin: https://github.com/UrbanCode/jenkins-pipeline-ucd-plugin . However, I cannot even tell if this is official. It is forked from another repo, has all broken documentation links and does not accept Issues. I guess I could study the source code and try to reverse engineer what I need. Everyone knows that Jenkins is the hardest interface in the world and I have not succeeded in ever understanding the source code of a plugin for it. I think one must first be an expert in Jenkins.
Assistance, documentation, code samples would all be appreciated.
------------------------------
Kevin Buchs
------------------------------