How can pass Hudson/Jenkins parameters to windows batch command

后端 未结 2 1026
南笙
南笙 2021-02-19 04:31

well i need to execute a batch file in my Hudson Job, I have a parameter(Jenkis parameter) and i need to pass this value like param to batch file, i tried this:

         


        
相关标签:
2条回答
  • 2021-02-19 04:42

    Execute your Batch file as like the below

    Deploy.cmd -configuration=%DEPLOYCONFIGURATION% -source=%DeploySource%
    

    In case your Jenkins server run in unix/ Linux machine use "export" command to set environment variable for windows use "set" command like the below

    For Windows:

    set DEPLOYCONFIGURATION=DEV
    set DeploySource=c:\myFolder
    

    For Unix:

    export DEPLOYCONFIGURATION = DEV
    export DeploySource=c:\myFolder 
    

    Hope it might solve your issue.

    Thanks, Madhan

    0 讨论(0)
  • 2021-02-19 04:43

    Use %DEPLOYCONFIGURATION% instead of ${DEPLOYCONFIGURATION} in windows batch command

    0 讨论(0)
提交回复
热议问题