how to add a configuration parameter with spaces on Jenkins

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to add a configuration parameter with spaces on Jenkins

Jesus Fernandez-2
I have a pipeline which builds a C++ project for that I am using MSBuild, untill now we were using the "Final" configuration parameter, but now I need to switch it to "Release Steam D3D11", when I try to do that I get an error on Jenkins when building the project I guess it is because of the spaces, how can I make Jenkins to take this parameter? this is what I have tried:

```
stage('Build'){
            steps{
                script {
                    def msbuild = tool name: 'MSBuild', type: 'hudson.plugins.msbuild.MsBuildInstallation'
                    bat "\"${msbuild}\" AoC/Source/project-GRDK.sln /t:Rebuild /p:configuration=Release Steam D3D11" 
                } 
            }
        }
```

I have also tried adding ' ' to the configuration name such as : 
```
bat "\"${msbuild}\" AoC/Source/project-GRDK.sln /t:Rebuild /p:configuration='Release Steam D3D11'" 
```
but it does not work neither

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2aa3d69f-c5ff-4dd2-9bab-2d1c8a9a5113n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: how to add a configuration parameter with spaces on Jenkins

Victor Martinez
Did you try with escaped double quotes?  Something like:

  • bat "\"${msbuild}\" AoC/Source/project-GRDK.sln /t:Rebuild /p:configuration=\"Release Steam D3D11\" " 

You can also use the multilne approach to avoid the escape of double quotes:

  • bat """ "${msbuild}" AoC/Source/project-GRDK.sln /t:Rebuild /p:configuration="Release Steam D3D11" """ 


On Friday, 6 November 2020 at 14:06:47 UTC [hidden email] wrote:
I have a pipeline which builds a C++ project for that I am using MSBuild, untill now we were using the "Final" configuration parameter, but now I need to switch it to "Release Steam D3D11", when I try to do that I get an error on Jenkins when building the project I guess it is because of the spaces, how can I make Jenkins to take this parameter? this is what I have tried:

```
stage('Build'){
            steps{
                script {
                    def msbuild = tool name: 'MSBuild', type: 'hudson.plugins.msbuild.MsBuildInstallation'
                    bat "\"${msbuild}\" AoC/Source/project-GRDK.sln /t:Rebuild /p:configuration=Release Steam D3D11" 
                } 
            }
        }
```

I have also tried adding ' ' to the configuration name such as : 
```
bat "\"${msbuild}\" AoC/Source/project-GRDK.sln /t:Rebuild /p:configuration='Release Steam D3D11'" 
```
but it does not work neither

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0550d41f-5f0a-4fc7-b3d8-fceb33322f02n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: how to add a configuration parameter with spaces on Jenkins

jesus fernandez
that worked! thanks!

El viernes, 6 de noviembre de 2020 a las 15:55:26 UTC+1, [hidden email] escribió:
Did you try with escaped double quotes?  Something like:

  • bat "\"${msbuild}\" AoC/Source/project-GRDK.sln /t:Rebuild /p:configuration=\"Release Steam D3D11\" " 

You can also use the multilne approach to avoid the escape of double quotes:

  • bat """ "${msbuild}" AoC/Source/project-GRDK.sln /t:Rebuild /p:configuration="Release Steam D3D11" """ 


On Friday, 6 November 2020 at 14:06:47 UTC [hidden email] wrote:
I have a pipeline which builds a C++ project for that I am using MSBuild, untill now we were using the "Final" configuration parameter, but now I need to switch it to "Release Steam D3D11", when I try to do that I get an error on Jenkins when building the project I guess it is because of the spaces, how can I make Jenkins to take this parameter? this is what I have tried:

```
stage('Build'){
            steps{
                script {
                    def msbuild = tool name: 'MSBuild', type: 'hudson.plugins.msbuild.MsBuildInstallation'
                    bat "\"${msbuild}\" AoC/Source/project-GRDK.sln /t:Rebuild /p:configuration=Release Steam D3D11" 
                } 
            }
        }
```

I have also tried adding ' ' to the configuration name such as : 
```
bat "\"${msbuild}\" AoC/Source/project-GRDK.sln /t:Rebuild /p:configuration='Release Steam D3D11'" 
```
but it does not work neither

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/878175da-9102-4fa8-9927-c6aee49b061cn%40googlegroups.com.