How to edit value of predefined configuration parameter from shell?
Hi, all! Please, help me with my problem.
In Maven step I used goals: "clean install sonar:sonar -Dsonar.forceAnalysis=true -Dsonar.branch=[%teamcity.build.branch%]".
Later I added configuration parameter "sonar_goals", and set it to "sonar:sonar -Dsonar.forceAnalysis=true -Dsonar.branch=[%teamcity.build.branch%]".
After that my Maven goals looked like: "clean install %sonar_goals%".
So, the problem.
In case of building master branch Maven step is failing because %teamcity.build.branch% returns value "<default>", and '<>' are illegal characters, which can't be passed to sonar plugin.
I decided to make command line step, which goes before Maven step and check if %teamcity.build.branch% equals <default>. In case of "<default>" value it should set %sonar_goals% to "sonar:sonar -Dsonar.forceAnalysis=true -Dsonar.branch=[master]" for further using in Maven step.
I've got check section of script:
if [ "%teamcity.build.branch%" = "<default>" ]
then
echo "Building master branch"
#set new value of %sonar_goals% here
fi
But have no idea, how to set new value of configuration parameter %sonar_goals% from shell-script.
Thank you all.
Please sign in to leave a comment.