Wikis - Page

Support for Jenkins Pipeline API in the Jenkins / Hudson HPI DA Plugin

0 Likes

Support for the Jenkins Pipeline API is now available for the Jenkins / Hudson HPI DA plugin. 

You can use the Jenkins Pipeline to create a Jenkins job in which you can create a Jenkinsfile instead of adding each build step to a Jenkins job. See https://jenkins.io/doc/book/pipeline/.

To use the Jenkins DA Plugin in a Jenkins Pipeline, you can use the available DA steps and their parameters.

To access the Jenkins / Hudson API plugin, see NEW - Sept 2017: Jenkins / Hudson HPI to publish to DA 6.x - 6.2.

USAGE

Run Global Process

step([$class: 'RunGlobalProcessNotifier',
// DA server to publish to, configured in global settings.
siteName: 'da-server',

// Use a build parameter to determine if a global process should be triggered in DA.
runGlobalProcessIf: 'true',

// Wait for a completion of a global process in DA and update job status based on the process result.
updateJobStatus: true,

// The name of the global process you want to execute.
globalProcessName: 'global-process',
// The name of the resource you want to execute the global process on.
resourceName: 'resource',
// Newline separated list of quoted properties and values i.e. prop1=${BUILD_NUMBER} to pass to DA global process.
globalProcessProperties: """
browser = firefox
upgrade = false
"""
])

Run Application Process

step([$class: 'RunApplicationProcessNotifier',
// DA server to publish to, configured in global settings.
siteName: 'da-server',

// Use a build parameter to determine if a application process should be triggered in DA.

runApplicationProcessIf: 'true'

// Wait for a completion of an application process in DA and update job status based on the process result.
updateJobStatus: true

// The name of the application in DA which will be used to deploy the version.
applicationName: 'application',
// The name of the environment in DA to deploy to.
environmentName: 'my-env',
// The name of the application process in DA which will be used to deploy the version.
applicationProcessName: 'app-process',
// The name of the component in the DA server.
componentName: 'component',
// The name of the version in the DA server.
versionName: env.BUILD_NUMBER,
// Newline separated list of properties and values to pass to DA application process.
applicationProcessProperties: 'prop1=value1'
])

Publish Artifacts to DA

step([$class: 'SerenaDAPublisher',
// DA server to publish to, configured in global settings.
siteName: 'da-server',

// The name of the component in the DA server.
component: 'component',
// Base directory where the artifacts are located.
baseDir: env.WORKSPACE,
// The name of the version in the DA server.
versionName: env.BUILD_NUMBER,
// A new line separated list of file filters to select the files to publish.
fileIncludePatterns: '**/*',
// A new line separated list of file filters to exclude from publishing.
fileExcludePatterns: '''
**/*tmp*
**/.git
''',
// Skip publishing (e.g. temporarily)
skip: false,

// Add status to this version in DA once it's uploaded.
addStatus: true,
// The full name of the status to apply to the Version.
statusName: 'version-status',

// Trigger a deployment of this version in DA once it's uploaded.
deploy: true,
// Use a build parameter to determine if a application process should be triggered in DA.
deployIf: 'true',
// Wait for a completion of an application process in DA and update job status based on the process result.
deployUpdateJobStatus: true,
// The name of the application in DA which will be used to deploy the version.
deployApp: 'application',
// The name of the environment in DA to deploy to.
deployEnv: 'dev-env',
// The name of the application process in DA which will be used to deploy the version.
deployProc: 'app-process',
// Newline separated list of properties and values to pass to DA application process.
deployProps: 'app-process-prop=some value'

// Execute a generic process in DA
runProcess: true,
// Use a build parameter to determine if a global process should be triggered in DA.
processIf: 'true',
// Wait for a completion of a global process in DA and update job status based on the process result.
processUpdateJobStatus: true,
// The name of the global process you want to execute.
processName: 'global-process',
// The name of the resource you want to execute the global process on.
resourceName: 'resource',
// Newline separated list of properties and values to pass to DA global process.
processProps: 'prop=some'
])

Update Artifacts status in DA

step([$class: 'UpdateComponentVersionStatusNotifier',
// DA server to publish to, configured in global settings.
siteName: 'da-server',

// ADD or REMOVE component version status
action: 'ADD',

// The name of the component in the DA server.
componentName: 'component',
// The name of the version in the DA server.
versionName: "${env.BUILD_NUMBER}",
// The full name of the status to apply to the Version.
statusName: 'version-status'
])

Tags:

Labels:

Plugin
Comment List
Related
Recommended