Praqma / JenkinsAsCodeReference

This repository is intended for the reference Jenkins configuration as code as well as JobDSL library
BSD 3-Clause "New" or "Revised" License
142 stars 110 forks source link

Add escaping when parsing the no_proxy env passed to gradlew #222

Closed mikejoh closed 6 years ago

mikejoh commented 6 years ago

In the jobdsl-gradle/src/jobs/resources/pipelines/jenkinsdeploy.groovy job we need to add escape sequences to the pipe-character so that the gradlew run works as expected:

        def nonProxy = ""
        if ( env.no_proxy ) {
            def hostList = env.no_proxy.replace(',','\\|')
            nonProxy = "-Dhttp.nonProxyHosts=${hostList} -Dhttps.nonProxyHosts=${hostList}".replace('\\|.','\\|*.')
        }