|
suresh kukalakuntla created JENKINS-13119:
--------------------------------------------- Summary: How can I set an environment variable based on value of user passed parameter? Key: JENKINS-13119 URL: https://issues.jenkins-ci.org/browse/JENKINS-13119 Project: Jenkins Issue Type: Improvement Components: envinject Affects Versions: current Environment: Redhat Linux 5.5 Reporter: suresh kukalakuntla Assignee: gbois I want to set value for an environment variable based on user provided input during the build and use this env variable to set workspace in a jenkins project. Ex: User has to select MODULE_NAME when performing a build. MODULE_NAME is a choice parameter. Based on the value selected by the user I want to set MODULE_FOLDER environment variable and use it for setting the WORKSPACE. Below is the functionality I am expecting. if MODULE_NAME is 'A' then set MODULE_FOLDER = FOLDER1 else if MODULE_NAME is 'B' then set MODULE_FOLDER = FOLDER2 else if MODULE_NAME is 'C' then set MODULE_FOLDER = FOLDER3 Now set WORKSPACE=/usr/modules/$MODULE_FOLDER Please help me achieve this functionality. I want to have only one job for all modules. Based on the module user selects I want to build it and deploy it. your guidance is much appreciated -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
[ https://issues.jenkins-ci.org/browse/JENKINS-13119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160371#comment-160371 ] SCM/JIRA link daemon commented on JENKINS-13119: ------------------------------------------------ Code changed in jenkins User: Gregory Boissinot Path: src/main/java/hudson/plugins/envfile/EnvFileBuildWrapper.java src/main/java/hudson/plugins/setenv/SetEnvBuildWrapper.java src/main/java/org/jenkinsci/plugins/envinject/EnvInjectJobPropertyInfo.java src/main/java/org/jenkinsci/plugins/envinject/EnvInjectListener.java src/main/java/org/jenkinsci/plugins/envinject/service/EnvInjectEnvVars.java src/main/java/org/jenkinsci/plugins/envinject/service/EnvInjectScriptExecutor.java src/main/resources/org/jenkinsci/plugins/envinject/EnvInjectJobProperty/config.jelly src/main/resources/org/jenkinsci/plugins/envinject/EnvInjectJobProperty/help-groovyScriptContent.html src/main/resources/org/jenkinsci/plugins/envinject/EnvInjectJobProperty/help-keepBuildVariables.html src/main/webapp/help.html src/test/java/org/jenkinsci/plugins/envinject/EnvInjectBuildWrapperTest.java http://jenkins-ci.org/commit/envinject-plugin/257acc17f1ae1560f95270d1c24aebc6b60d0261 Log: Fix JENKINS-13119 > How can I set an environment variable based on value of user passed parameter? > ------------------------------------------------------------------------------ > > Key: JENKINS-13119 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13119 > Project: Jenkins > Issue Type: Improvement > Components: envinject > Affects Versions: current > Environment: Redhat Linux 5.5 > Reporter: suresh kukalakuntla > Assignee: gbois > > I want to set value for an environment variable based on user provided input during the build and use this env variable to set workspace in a jenkins project. > Ex: User has to select MODULE_NAME when performing a build. MODULE_NAME is a choice parameter. Based on the value selected by the user I want to set MODULE_FOLDER environment variable and use it for setting the WORKSPACE. > Below is the functionality I am expecting. > if MODULE_NAME is 'A' then set MODULE_FOLDER = FOLDER1 > else if MODULE_NAME is 'B' then set MODULE_FOLDER = FOLDER2 > else if MODULE_NAME is 'C' then set MODULE_FOLDER = FOLDER3 > Now set WORKSPACE=/usr/modules/$MODULE_FOLDER > Please help me achieve this functionality. I want to have only one job for all modules. Based on the module user selects I want to build it and deploy it. > your guidance is much appreciated -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
In reply to this post by JIRA noreply@jenkins-ci.org
[ https://issues.jenkins-ci.org/browse/JENKINS-13119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] gbois resolved JENKINS-13119. ----------------------------- Resolution: Fixed I added the ability to evaluate a Groovy script in 'Prepare environment for the build' section For example, you can have the following script: if (CASE==null){ return null; } def stringValue="StRinG"; if ("upper".equals(CASE)){ def map = [COMPUTE_VAR: stringValue.toUpperCase()] return map } if ("lower".equals(CASE)){ def map = [COMPUTE_VAR: stringValue.toLowerCase()] return map } This script injects the environment COMPUTE_VAR in the following job steps. As you see, this variable is computed according the CASE variable value. This variable comes from a parameter value (given by the user). The only restrictions are: - The script has to be in Groovy (close to Jenkins core, written in Java/Groovy) - The script has to return a Map Java object (all the map elements will exported as environment variables). Please upgrade to EnvInject 1.38. Let me know if it suits you. > How can I set an environment variable based on value of user passed parameter? > ------------------------------------------------------------------------------ > > Key: JENKINS-13119 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13119 > Project: Jenkins > Issue Type: Improvement > Components: envinject > Affects Versions: current > Environment: Redhat Linux 5.5 > Reporter: suresh kukalakuntla > Assignee: gbois > > I want to set value for an environment variable based on user provided input during the build and use this env variable to set workspace in a jenkins project. > Ex: User has to select MODULE_NAME when performing a build. MODULE_NAME is a choice parameter. Based on the value selected by the user I want to set MODULE_FOLDER environment variable and use it for setting the WORKSPACE. > Below is the functionality I am expecting. > if MODULE_NAME is 'A' then set MODULE_FOLDER = FOLDER1 > else if MODULE_NAME is 'B' then set MODULE_FOLDER = FOLDER2 > else if MODULE_NAME is 'C' then set MODULE_FOLDER = FOLDER3 > Now set WORKSPACE=/usr/modules/$MODULE_FOLDER > Please help me achieve this functionality. I want to have only one job for all modules. Based on the module user selects I want to build it and deploy it. > your guidance is much appreciated -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
In reply to this post by JIRA noreply@jenkins-ci.org
[ https://issues.jenkins-ci.org/browse/JENKINS-13119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160374#comment-160374 ] gbois edited comment on JENKINS-13119 at 3/18/12 9:51 AM: ---------------------------------------------------------- I added the ability to evaluate a Groovy script in 'Prepare environment for the build' section For example, you can have the following script: if (CASE==null){ return null; } def stringValue="StRinG"; if ("upper".equals(CASE)){ def map = [COMPUTE_VAR: stringValue.toUpperCase()] return map } if ("lower".equals(CASE)){ def map = [COMPUTE_VAR: stringValue.toLowerCase()] return map } This script injects the environment COMPUTE_VAR in the following job steps. As you can see, this variable is computed according the CASE variable value. This variable comes from a parameter value (given by the user). The only restrictions are: - The script has to be in Groovy (close to Jenkins core, written in Java/Groovy) - The script has to return a Map Java object (all the map elements will exported as environment variables). Please upgrade to EnvInject 1.38. Let me know if it suits you. was (Author: gbois): I added the ability to evaluate a Groovy script in 'Prepare environment for the build' section For example, you can have the following script: if (CASE==null){ return null; } def stringValue="StRinG"; if ("upper".equals(CASE)){ def map = [COMPUTE_VAR: stringValue.toUpperCase()] return map } if ("lower".equals(CASE)){ def map = [COMPUTE_VAR: stringValue.toLowerCase()] return map } This script injects the environment COMPUTE_VAR in the following job steps. As you see, this variable is computed according the CASE variable value. This variable comes from a parameter value (given by the user). The only restrictions are: - The script has to be in Groovy (close to Jenkins core, written in Java/Groovy) - The script has to return a Map Java object (all the map elements will exported as environment variables). Please upgrade to EnvInject 1.38. Let me know if it suits you. > How can I set an environment variable based on value of user passed parameter? > ------------------------------------------------------------------------------ > > Key: JENKINS-13119 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13119 > Project: Jenkins > Issue Type: Improvement > Components: envinject > Affects Versions: current > Environment: Redhat Linux 5.5 > Reporter: suresh kukalakuntla > Assignee: gbois > > I want to set value for an environment variable based on user provided input during the build and use this env variable to set workspace in a jenkins project. > Ex: User has to select MODULE_NAME when performing a build. MODULE_NAME is a choice parameter. Based on the value selected by the user I want to set MODULE_FOLDER environment variable and use it for setting the WORKSPACE. > Below is the functionality I am expecting. > if MODULE_NAME is 'A' then set MODULE_FOLDER = FOLDER1 > else if MODULE_NAME is 'B' then set MODULE_FOLDER = FOLDER2 > else if MODULE_NAME is 'C' then set MODULE_FOLDER = FOLDER3 > Now set WORKSPACE=/usr/modules/$MODULE_FOLDER > Please help me achieve this functionality. I want to have only one job for all modules. Based on the module user selects I want to build it and deploy it. > your guidance is much appreciated -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
In reply to this post by JIRA noreply@jenkins-ci.org
[ https://issues.jenkins-ci.org/browse/JENKINS-13119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160383#comment-160383 ] gbois commented on JENKINS-13119: --------------------------------- And for your need, you have to select a custom workspace and use your computed variable. > How can I set an environment variable based on value of user passed parameter? > ------------------------------------------------------------------------------ > > Key: JENKINS-13119 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13119 > Project: Jenkins > Issue Type: Improvement > Components: envinject > Affects Versions: current > Environment: Redhat Linux 5.5 > Reporter: suresh kukalakuntla > Assignee: gbois > > I want to set value for an environment variable based on user provided input during the build and use this env variable to set workspace in a jenkins project. > Ex: User has to select MODULE_NAME when performing a build. MODULE_NAME is a choice parameter. Based on the value selected by the user I want to set MODULE_FOLDER environment variable and use it for setting the WORKSPACE. > Below is the functionality I am expecting. > if MODULE_NAME is 'A' then set MODULE_FOLDER = FOLDER1 > else if MODULE_NAME is 'B' then set MODULE_FOLDER = FOLDER2 > else if MODULE_NAME is 'C' then set MODULE_FOLDER = FOLDER3 > Now set WORKSPACE=/usr/modules/$MODULE_FOLDER > Please help me achieve this functionality. I want to have only one job for all modules. Based on the module user selects I want to build it and deploy it. > your guidance is much appreciated -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
In reply to this post by JIRA noreply@jenkins-ci.org
[ https://issues.jenkins-ci.org/browse/JENKINS-13119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160423#comment-160423 ] suresh kukalakuntla commented on JENKINS-13119: ----------------------------------------------- Thank You so much Greg for your quick response, with a plugin update!!! I installed EnvInject 1.38, added similar groovy script to my job and tried to build it. I got the below error. [EnvInject] - Preparing an environment for the build. [EnvInject] - [ERROR] - SEVERE ERROR occurs: com/sun/xml/internal/ws/server/UnsupportedMediaException I think I have to add required jar to class path of JBOSS AS 7 I am using for jenkins, which I do not know how to. I am trying to find out how to do that. Could you please let me know how to do that, if you already know about it? I will provide an update once I am able to successfully use the updated plugin to set environment variables based on user input. Thank You once again for your effort. > How can I set an environment variable based on value of user passed parameter? > ------------------------------------------------------------------------------ > > Key: JENKINS-13119 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13119 > Project: Jenkins > Issue Type: Improvement > Components: envinject > Affects Versions: current > Environment: Redhat Linux 5.5 > Reporter: suresh kukalakuntla > Assignee: gbois > > I want to set value for an environment variable based on user provided input during the build and use this env variable to set workspace in a jenkins project. > Ex: User has to select MODULE_NAME when performing a build. MODULE_NAME is a choice parameter. Based on the value selected by the user I want to set MODULE_FOLDER environment variable and use it for setting the WORKSPACE. > Below is the functionality I am expecting. > if MODULE_NAME is 'A' then set MODULE_FOLDER = FOLDER1 > else if MODULE_NAME is 'B' then set MODULE_FOLDER = FOLDER2 > else if MODULE_NAME is 'C' then set MODULE_FOLDER = FOLDER3 > Now set WORKSPACE=/usr/modules/$MODULE_FOLDER > Please help me achieve this functionality. I want to have only one job for all modules. Based on the module user selects I want to build it and deploy it. > your guidance is much appreciated -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
In reply to this post by JIRA noreply@jenkins-ci.org
[ https://issues.jenkins-ci.org/browse/JENKINS-13119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160428#comment-160428 ] gbois commented on JENKINS-13119: --------------------------------- Maybe a JBOSS issue with Groovy. Do you have the ability to test on another servlet container such as Tomcat? > How can I set an environment variable based on value of user passed parameter? > ------------------------------------------------------------------------------ > > Key: JENKINS-13119 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13119 > Project: Jenkins > Issue Type: Improvement > Components: envinject > Affects Versions: current > Environment: Redhat Linux 5.5 > Reporter: suresh kukalakuntla > Assignee: gbois > > I want to set value for an environment variable based on user provided input during the build and use this env variable to set workspace in a jenkins project. > Ex: User has to select MODULE_NAME when performing a build. MODULE_NAME is a choice parameter. Based on the value selected by the user I want to set MODULE_FOLDER environment variable and use it for setting the WORKSPACE. > Below is the functionality I am expecting. > if MODULE_NAME is 'A' then set MODULE_FOLDER = FOLDER1 > else if MODULE_NAME is 'B' then set MODULE_FOLDER = FOLDER2 > else if MODULE_NAME is 'C' then set MODULE_FOLDER = FOLDER3 > Now set WORKSPACE=/usr/modules/$MODULE_FOLDER > Please help me achieve this functionality. I want to have only one job for all modules. Based on the module user selects I want to build it and deploy it. > your guidance is much appreciated -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
In reply to this post by JIRA noreply@jenkins-ci.org
[ https://issues.jenkins-ci.org/browse/JENKINS-13119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160429#comment-160429 ] suresh kukalakuntla commented on JENKINS-13119: ----------------------------------------------- I am able to to put the required jar file in the lib folder of jenkins.war and I am able to use ENVInject successfully. Right now I am trying to test Evaluated Groovy script. Tried the below and got and error [EnvInject] - Evaluation the following Groovy script content: if (MODULE_NAME==null){ return null; } if ("ACCT".equals(MODULE_NAME)){ def map = ["MODULE_HOME": "SSP-AM"] return map } if ("FPD".equals(MODULE_NAME)){ def map = ["MODULE_HOME": "SSP-FPD"] return map } [EnvInject] - [ERROR] - SEVERE ERROR occurs: startup failed: Script1.groovy: 3: expecting '}', found 'return' @ line 3, column 70. p = ["MODULE_HOME": "SSP-AM"] return map ^ 1 error > How can I set an environment variable based on value of user passed parameter? > ------------------------------------------------------------------------------ > > Key: JENKINS-13119 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13119 > Project: Jenkins > Issue Type: Improvement > Components: envinject > Affects Versions: current > Environment: Redhat Linux 5.5 > Reporter: suresh kukalakuntla > Assignee: gbois > > I want to set value for an environment variable based on user provided input during the build and use this env variable to set workspace in a jenkins project. > Ex: User has to select MODULE_NAME when performing a build. MODULE_NAME is a choice parameter. Based on the value selected by the user I want to set MODULE_FOLDER environment variable and use it for setting the WORKSPACE. > Below is the functionality I am expecting. > if MODULE_NAME is 'A' then set MODULE_FOLDER = FOLDER1 > else if MODULE_NAME is 'B' then set MODULE_FOLDER = FOLDER2 > else if MODULE_NAME is 'C' then set MODULE_FOLDER = FOLDER3 > Now set WORKSPACE=/usr/modules/$MODULE_FOLDER > Please help me achieve this functionality. I want to have only one job for all modules. Based on the module user selects I want to build it and deploy it. > your guidance is much appreciated -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
In reply to this post by JIRA noreply@jenkins-ci.org
[ https://issues.jenkins-ci.org/browse/JENKINS-13119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160431#comment-160431 ] suresh kukalakuntla commented on JENKINS-13119: ----------------------------------------------- Greg, I am able to successfully run the groovy script that serves my purpose. I really appreciate your help and time. You are very responsive and quick:) Below is the log. MODULE_NAME is provided by user when performing build. [EnvInject] - Evaluation the following Groovy script content: if(MODULE_NAME.equals('ACCT')) { def map = ["MODULE_HOME": "SSP-AM"] return map; } if(MODULE_NAME.equals('FPD')) { def map = ["MODULE_HOME": "SSP-FPD"] return map; } Building in workspace /usr/J2EE/JENKINS/jobs/TEST_GROOVY/workspace [workspace] $ /bin/sh -xe /tmp/hudson50466.sh + echo MODULE_NAME:FPD MODULE_NAME:FPD + echo MODULE_HOME:SSP-FPD MODULE_HOME:SSP-FPD Finished: SUCCESS > How can I set an environment variable based on value of user passed parameter? > ------------------------------------------------------------------------------ > > Key: JENKINS-13119 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13119 > Project: Jenkins > Issue Type: Improvement > Components: envinject > Affects Versions: current > Environment: Redhat Linux 5.5 > Reporter: suresh kukalakuntla > Assignee: gbois > > I want to set value for an environment variable based on user provided input during the build and use this env variable to set workspace in a jenkins project. > Ex: User has to select MODULE_NAME when performing a build. MODULE_NAME is a choice parameter. Based on the value selected by the user I want to set MODULE_FOLDER environment variable and use it for setting the WORKSPACE. > Below is the functionality I am expecting. > if MODULE_NAME is 'A' then set MODULE_FOLDER = FOLDER1 > else if MODULE_NAME is 'B' then set MODULE_FOLDER = FOLDER2 > else if MODULE_NAME is 'C' then set MODULE_FOLDER = FOLDER3 > Now set WORKSPACE=/usr/modules/$MODULE_FOLDER > Please help me achieve this functionality. I want to have only one job for all modules. Based on the module user selects I want to build it and deploy it. > your guidance is much appreciated -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
In reply to this post by JIRA noreply@jenkins-ci.org
[ https://issues.jenkins-ci.org/browse/JENKINS-13119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160434#comment-160434 ] gbois commented on JENKINS-13119: --------------------------------- Try to use return line Copy paste the following script, it should work if (MODULE_NAME==null){ return null; } if ("ACCT".equals(MODULE_NAME)){ def map = [MODULE_HOME: "SSP-AM"] return map } if ("FPD".equals(MODULE_NAME)){ def map = [MODULE_HOME: "SSP-FPD"] return map } > How can I set an environment variable based on value of user passed parameter? > ------------------------------------------------------------------------------ > > Key: JENKINS-13119 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13119 > Project: Jenkins > Issue Type: Improvement > Components: envinject > Affects Versions: current > Environment: Redhat Linux 5.5 > Reporter: suresh kukalakuntla > Assignee: gbois > > I want to set value for an environment variable based on user provided input during the build and use this env variable to set workspace in a jenkins project. > Ex: User has to select MODULE_NAME when performing a build. MODULE_NAME is a choice parameter. Based on the value selected by the user I want to set MODULE_FOLDER environment variable and use it for setting the WORKSPACE. > Below is the functionality I am expecting. > if MODULE_NAME is 'A' then set MODULE_FOLDER = FOLDER1 > else if MODULE_NAME is 'B' then set MODULE_FOLDER = FOLDER2 > else if MODULE_NAME is 'C' then set MODULE_FOLDER = FOLDER3 > Now set WORKSPACE=/usr/modules/$MODULE_FOLDER > Please help me achieve this functionality. I want to have only one job for all modules. Based on the module user selects I want to build it and deploy it. > your guidance is much appreciated -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
In reply to this post by JIRA noreply@jenkins-ci.org
[ https://issues.jenkins-ci.org/browse/JENKINS-13119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160435#comment-160435 ] gbois commented on JENKINS-13119: --------------------------------- Wiki removes return line. Otherwise, add a semicolon, for example: if (MODULE_NAME==null){ return null; } if ("ACCT".equals(MODULE_NAME)){ def map = [MODULE_HOME: "SSP-AM"] ; return map } if ("FPD".equals(MODULE_NAME)){ def map = [MODULE_HOME: "SSP-FPD"] ; return map } > How can I set an environment variable based on value of user passed parameter? > ------------------------------------------------------------------------------ > > Key: JENKINS-13119 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13119 > Project: Jenkins > Issue Type: Improvement > Components: envinject > Affects Versions: current > Environment: Redhat Linux 5.5 > Reporter: suresh kukalakuntla > Assignee: gbois > > I want to set value for an environment variable based on user provided input during the build and use this env variable to set workspace in a jenkins project. > Ex: User has to select MODULE_NAME when performing a build. MODULE_NAME is a choice parameter. Based on the value selected by the user I want to set MODULE_FOLDER environment variable and use it for setting the WORKSPACE. > Below is the functionality I am expecting. > if MODULE_NAME is 'A' then set MODULE_FOLDER = FOLDER1 > else if MODULE_NAME is 'B' then set MODULE_FOLDER = FOLDER2 > else if MODULE_NAME is 'C' then set MODULE_FOLDER = FOLDER3 > Now set WORKSPACE=/usr/modules/$MODULE_FOLDER > Please help me achieve this functionality. I want to have only one job for all modules. Based on the module user selects I want to build it and deploy it. > your guidance is much appreciated -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
In reply to this post by JIRA noreply@jenkins-ci.org
|
|||||||||||||||||
|
In reply to this post by JIRA noreply@jenkins-ci.org
|
|||||||||||
|
In reply to this post by JIRA noreply@jenkins-ci.org
|
|||||||||||
|
In reply to this post by JIRA noreply@jenkins-ci.org
|
|||||||||||
|
In reply to this post by JIRA noreply@jenkins-ci.org
|
|||||||||||
|
In reply to this post by JIRA noreply@jenkins-ci.org
|
| Powered by Nabble | Edit this page |

I have this groovy script:
if (BUILD_TYPE.equals('Trunk')) { def map = [SVN_REPO_PATH: "trunk/ConfigManagement"]; return map; }
if (BUILD_TYPE.equals('Branches')) {
def map = [SVN_REPO_PATH: "branches/${SVN_BRANCH}"]; return map;
}
if (BUILD_TYPE.equals('Tags')) {
def map = [SVN_REPO_PATH: "branches/${SVN_TAG}"]; return map;
}
Where BUILD_TYPE is a CHOICE type user parameter which has Trunk, Branches, Tags in the drop down.
The build keeps failing with,
[EnvInject] - [ERROR] - SEVERE ERROR occurs: No such property: BUILD_TYPE for class: Script1
Finished: FAILURE
Please Help