I have a string parameter configuring for a junkkin job called "Job_Name".
I want to check the value given to the parameter to run Jenkins's "shell command".
My current shell command is in the picture below.
shell command:
if ["$ {Job_Name}}" == "RSProductPreprocessor"]; Then ANSIBLE_HOST_KEY_CHECKING = Wrong answer-playbook -i host / Dev PlayBook_DisplayProcessorCorrect IML-v --extra-Vars "RSProductPreProcessorVersion = $ {Number_Of_RSProductPreProcessor_Build_To_Deploy}" fi
But I get this feedback as below when I get a job.
+ '[' '' == 'RSP Product Prospector'] 'Finished: Success: If Condition needs to be done properly Please advise.
There are some things to fix with you
click the link < / P>
BUILD_NUMBER Existing build number, such as "153" BUILD_ID current build id, such as "2005-08-22_23-59-59" (YYYY-MM-DD_hh -mm-ss) BUILD_DISPLAY_NAME display name of the current build, which is the same as "# 153" JOB_NAME name of the project for this build, such as "foo" or "foo / bar" (stripping the folder path from the barn shell script For, try: $ {JOB_NAME ## * /})
You need $ {JOB_NAME}
capitals
and compare to shell
if ["$ {JOB_NAME}" = "xxxx "]; So ANSIBLE_HOST_KEY_CHECKING = incorrect ansible-playbook -i host / dev playbook_deployRSProductPreProcessor.yml -v --extra-vars "RSProductPreProcessorVersion = $ {Number_Of_RSProductPreProcessor_Build_To_Deploy}" file
so only a = < / Code>
Your Jenkins can use a different shell for me, so that you can force the force by adding a Shebang to the first line
#! / Bin / bash
No comments:
Post a Comment