A member of our development team has written a function to use in our automation process, but he has since left. We are now trying to use it but I have little guidance in the realm of Jenkins.
The code our mystery dev provided:
function RunJenkinsBuild ($jenkinsHost, $jobName, $jobParams) {
$url = "$jenkinsUri/job/$($jobName)/api/json"
$job = Invoke-JenkinsCommand -uri $url -Command lastBuild
$nextBuildID = $job.nextBuildNumber
Invoke-JenkinsJob -Uri $jenkinsUri -Name $jobName -Parameters $jobParams
$url = "$jenkinsUri/job/$($jobName)/$($nextBuildID)/api/json"
The code I've tried to get to work
RunJenkinsBuild "jenkins:8080", "SetTag(Rollback)", "BRANCHVAR=$latestTag"
Basically, I'm trying to get the whole "BRANCHVAR=$latestTag"
to work, but it doesn't pass in correctly.
Any help would be appreciated! Thanks!