Adding Required Dependencies to Jenkins
If your Jenkins instance is installed on a Windows platform, it will be necessary to install the Powershell Plugin (https://wiki.jenkins-ci.org/display/JENKINS/PowerShell+Plugin). This plugin will be needed in order to make an outbound ReST request to the ISPW API. In order to install the plugin, click Manage Jenkins > Manage Plugins, then open the Available tab and search for “Powershell” and install the plugin. Jenkins may require a restart to complete installation.
NOTE: If the Jenkins instance is installed on a Unix or Linux platform, this plugin is not necessary. Instead, use the curl shell command.
In this example, we’ll create a project called “Build_1”. This build won’t pull source down from a source control repository or actually build any binaries; we’re only using it for demonstration purposes. However, the steps we’ll add can be added to any existing build in your Jenkins configuration. We’ll be adding a script to Build_1 that will call the ISPW ReST API, deploy all the tasks in release myrlease currently in level dev1, and then configure 2 webhooks: one to build a different Jenkins project (Build_2) on a successful deploy, and one to disable that project on a failure.
From the Jenkins homepage, click “New Item”, give the item the name “Build_1”, select “Freestyle Project” from the menu, scroll down and hit “OK”. You’ll now be brought to the configuration page for the project. Scroll to the bottom and locate the “Build” section. In the “Add build step” dropdown, select Powershell (or Execute Shell on Unix/Linux). Add the following shell snippet (see general API documentation for curl version):