Hi ALL ,
I am new to this group and need your help for the below issue :
I am trying to automate getting the jenkin's job status by running the below command in post build -> Execute shell .
JOB_STATUS=`curl -silent -k -u USER_NAME:API_TOKEN https://URL_NAME/jenkins/job/$JOB_NAME/lastBuild/api/json | grep -iEo 'result":"\w*’`
My question : How to avoid passing USER_NAME:API_TOKEN explicitly in jenkin’s job ? Is there any way hide my user credential for automating jenkin’s job status ?
is there way to get the Job status by just passing predefined environment variable , advice please
NOTE : Why i am asking this question , after automated plan to share my job with my team and i should not share access_token according to company policy
Thanks ,
Muthu Selvan SR