Closed piyush94 closed 5 years ago
As discussed, the Jenkins build should be done from the Run Task at the Domain Level (where the "launch dialog" would appear). Having it part of the pre-task will be confusing since you will be deploying an old version to get the pre-action to execute and create the new version to build and deploy.
We will create a procedure to kick off the Jenkins Job.
CC: @svisagan83
The Jenkins Job procedure should be imported into the "GLOBAL" domain under the Functions/Procedure Tree view. You will need to create an Action that uses the procedure. At the action level you can set the Jenkins Server and Credential names. This new action will be called by a Run Task at the Domain level. See the screen shot for example setup.
@piyush94 - I would create an action in each domain that a Jenkins Job should be run from and hard code the parameters Then the Run Task would be setup in the same domain using that action. This will make it very easy to find the right job to run and have it secured properly.
CC: @svisagan83
@sbtaylor15 I tried the above procedure. One correction for the first request it needs to be restful_get()
. restful_post()
gives 403 code.
set res = restful_get("${jenkins_server}/crumbIssuer/api/json",null,null,$cred);
One more issue, the build is not happening as the Job is inside a folder which looks like this:
job/DH_POC/job/AppUI_Helm
where AppUI_Helm is the job to run.
CC: @svisagan83
@sbtaylor15 If i give the job name as DH_POC/job/AppUI_Helm
, it works.
CC: @svisagan83
@piyush94 DH_POC/job/AppUI_Helm
is the correct format for the Job name that is in sub-folder.
Did you get past the 403 error?
CC: @svisagan83
@sbtaylor15 Yes i got past the 403 error by changing the restful_post
to restful_get
for the first request.
set res = restful_get("${jenkins_server}/crumbIssuer/api/json",null,null,$cred);
CC: @svisagan83
A pre action to trigger Jenkins Job build before Deploy action.
CC: @svisagan83