I’m able to start a process in my Jenkins pipeline easily, but I’m struggling to avoid being blocked by the process.
Currently, Jenkins is waiting for its end before going on to the next step, but I need this process to be active during the whole build.
I tried with a lot of different ways, without success. Here a snippet:
Jenkins Pipeline:
stage ('Start process') {
steps {
script {
powershell """
try {
. ${WORKSPACE}\Scripts\StartMyProcess.ps1 `
-BuildID ${env.BUILD_NUMBER} `
-BuildNumber ${env.BUILD_NUMBER} `
-BuildVCSBranch ${GIT_BRANCH}
} catch {
Write-Error $_
exit 1
}
"""
}
}
}
PS1 File:
param (
[Parameter(Mandatory)] [string] $BuildId,
[Parameter()] [string] $BuildNumber,
[Parameter()] [string] $BuildVCSBranch
)
& "${PSScriptRoot}MyBot.exe" `
-MyBot `
-BuildID $BuildID `
-BuildNumber $BuildNumber `
-BuildVCSBranch $BuildVCSBranch
Thank you in advance,
Luca