Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5790

Parameterize Tomcat Context Path and URL Fields

    Details

    • Similar Issues:

      Description

      Actually, we can set parameters to deploy the application on a given container.
      It would be great to be able to set a parameter for the URL of the container. It would be a way to deploy application for test on a given environment according to the user's choice (for example, one on Unix and the other on Windows tomcat container). Without having to duplicate jobs.

      Thanks

        Attachments

          Issue Links

            Activity

            Hide
            zacharysyoung Zachary Young added a comment -

            And to this, please allow the context path to be parameterized as well: both of these parameters are crucial for DRY pipelines.

            Show
            zacharysyoung Zachary Young added a comment - And to this, please allow the context path to be parameterized as well: both of these parameters are crucial for DRY pipelines.
            Hide
            jackett_dad Scott Ellis added a comment -

            Add me as an interested party in this feature. I have three different servers to which I deploy an application, and it looks like I am going to have to create a job for each one. Thanks!

            Show
            jackett_dad Scott Ellis added a comment - Add me as an interested party in this feature. I have three different servers to which I deploy an application, and it looks like I am going to have to create a job for each one. Thanks!
            Hide
            lior_kn Lior Knaany added a comment -

            I support this feature request.
            I need to change tomcat URL according to a parameter (e.g. ${DEPLOY_SERVER_URL})

            Show
            lior_kn Lior Knaany added a comment - I support this feature request. I need to change tomcat URL according to a parameter (e.g. ${DEPLOY_SERVER_URL})
            Show
            barrusj Jeffrey Barrus added a comment - https://github.com/jenkinsci/deploy-plugin/pull/11
            Hide
            djl2 Darrell Lowrance added a comment -

            Please add support for this feature. It's actually very surprising to learn that this plugin has never supported Jenkins/Hudson variables.

            Show
            djl2 Darrell Lowrance added a comment - Please add support for this feature. It's actually very surprising to learn that this plugin has never supported Jenkins/Hudson variables.
            Hide
            djl2 Darrell Lowrance added a comment -

            See similar/duplicate request at https://issues.jenkins-ci.org/browse/JENKINS-18257

            Thanks in advance.

            Show
            djl2 Darrell Lowrance added a comment - See similar/duplicate request at https://issues.jenkins-ci.org/browse/JENKINS-18257 Thanks in advance.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Bruno P. Kinoshita
            Path:
            src/main/java/hudson/plugins/deploy/DeployPublisher.java
            http://jenkins-ci.org/commit/deploy-plugin/ce2fc7f51ba35f9854d1d683ec72b2079c436282
            Log:
            [FIXED JENKINS-5790] Expand tomcat context path with build variables

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bruno P. Kinoshita Path: src/main/java/hudson/plugins/deploy/DeployPublisher.java http://jenkins-ci.org/commit/deploy-plugin/ce2fc7f51ba35f9854d1d683ec72b2079c436282 Log: [FIXED JENKINS-5790] Expand tomcat context path with build variables
            Hide
            vadakr Ranjit Vadakkan added a comment - - edited

            Note that using URL parameters like so -

            http://${DEPLOY_SERVER}:${DEPLOY_PORT}

            does not work. It complains about ${DEPLOY_PORT}.

            FATAL: java.net.MalformedURLException: For input string: "${DEPLOY_PORT}"
            java.lang.AssertionError: java.net.MalformedURLException: For input string: "${DEPLOY_PORT}"
            at hudson.plugins.deploy.tomcat.TomcatAdapter.configure(TomcatAdapter.java:35)
            at hudson.plugins.deploy.CargoContainerAdapter.getContainer(CargoContainerAdapter.java:56)
            at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:114)
            at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
            at hudson.FilePath.act(FilePath.java:912)
            at hudson.FilePath.act(FilePath.java:885)
            at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
            at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
            at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
            at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781)
            at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:753)
            at hudson.model.Build$BuildExecution.post2(Build.java:183)
            at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706)
            at hudson.model.Run.execute(Run.java:1690)
            at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
            at hudson.model.ResourceController.execute(ResourceController.java:88)
            at hudson.model.Executor.run(Executor.java:230)
            Caused by: java.net.MalformedURLException: For input string: "${DEPLOY_PORT}"
            at java.net.URL.<init>(URL.java:601)
            at java.net.URL.<init>(URL.java:464)
            at java.net.URL.<init>(URL.java:413)
            at hudson.plugins.deploy.tomcat.TomcatAdapter.configure(TomcatAdapter.java:32)
            ... 16 more

            So I assumed it didn't like 2 parameters separated by the ':' and so I tried http://${DEPLOY_SERVER}, but no luck with that either -

            ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
            org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\Program Files (x86)\Jenkins\jobs\EPC DEV Emma\workspace\build\artifacts\wars\ecosys-instr.war]
            at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:193)
            at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
            at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
            at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
            at hudson.FilePath.act(FilePath.java:912)
            at hudson.FilePath.act(FilePath.java:885)
            at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
            at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
            at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
            at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781)
            at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:753)
            at hudson.model.Build$BuildExecution.post2(Build.java:183)
            at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706)
            at hudson.model.Run.execute(Run.java:1690)
            at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
            at hudson.model.ResourceController.execute(ResourceController.java:88)
            at hudson.model.Executor.run(Executor.java:230)
            Caused by: java.net.UnknownHostException: ${DEPLOY_SERVER}
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
            at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
            at java.net.Socket.connect(Socket.java:529)
            at java.net.Socket.connect(Socket.java:478)
            at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
            at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
            at sun.net.www.http.HttpClient.New(HttpClient.java:306)
            at sun.net.www.http.HttpClient.New(HttpClient.java:323)
            at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:975)
            at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:916)
            at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:841)
            at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:534)
            at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
            at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
            at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
            ... 16 more

            I am running Deploy v1.10 inside Jenkins 1.536

            Show
            vadakr Ranjit Vadakkan added a comment - - edited Note that using URL parameters like so - http://$ {DEPLOY_SERVER}:${DEPLOY_PORT} does not work. It complains about ${DEPLOY_PORT}. FATAL: java.net.MalformedURLException: For input string: "${DEPLOY_PORT}" java.lang.AssertionError: java.net.MalformedURLException: For input string: "${DEPLOY_PORT}" at hudson.plugins.deploy.tomcat.TomcatAdapter.configure(TomcatAdapter.java:35) at hudson.plugins.deploy.CargoContainerAdapter.getContainer(CargoContainerAdapter.java:56) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:114) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103) at hudson.FilePath.act(FilePath.java:912) at hudson.FilePath.act(FilePath.java:885) at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103) at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:753) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706) at hudson.model.Run.execute(Run.java:1690) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:230) Caused by: java.net.MalformedURLException: For input string: "${DEPLOY_PORT}" at java.net.URL.<init>(URL.java:601) at java.net.URL.<init>(URL.java:464) at java.net.URL.<init>(URL.java:413) at hudson.plugins.deploy.tomcat.TomcatAdapter.configure(TomcatAdapter.java:32) ... 16 more So I assumed it didn't like 2 parameters separated by the ':' and so I tried http://$ {DEPLOY_SERVER}, but no luck with that either - ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\Program Files (x86)\Jenkins\jobs\EPC DEV Emma\workspace\build\artifacts\wars\ecosys-instr.war] at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:193) at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103) at hudson.FilePath.act(FilePath.java:912) at hudson.FilePath.act(FilePath.java:885) at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103) at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:753) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706) at hudson.model.Run.execute(Run.java:1690) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:230) Caused by: java.net.UnknownHostException: ${DEPLOY_SERVER} at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at java.net.Socket.connect(Socket.java:478) at sun.net.NetworkClient.doConnect(NetworkClient.java:163) at sun.net.www.http.HttpClient.openServer(HttpClient.java:394) at sun.net.www.http.HttpClient.openServer(HttpClient.java:529) at sun.net.www.http.HttpClient.<init>(HttpClient.java:233) at sun.net.www.http.HttpClient.New(HttpClient.java:306) at sun.net.www.http.HttpClient.New(HttpClient.java:323) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:975) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:916) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:841) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:534) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174) ... 16 more I am running Deploy v1.10 inside Jenkins 1.536

              People

              • Assignee:
                Unassigned
                Reporter:
                abegey abegey
              • Votes:
                10 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: