[jbosstools-dev] FYI: parent pom variable jbosstools-site-stream has been renamed to jbosstools_stream in master branch

Nick Boldt nboldt at redhat.com
Fri Mar 13 15:19:32 EDT 2015


To restate the problem a 3rd time:

* Jenkins bash scripts (such as the newer, simpler, easier rsync.sh 
replacement for the crazy complicated publish.sh) can't expand a 
variable that's named with dashes.

* Parent pom uses variables with dashes.

* Therefore to use the SAME variable in Jenkins and in Maven, we need to 
rename the variable.

To explain the need for both jbosstools_stream and jbosstools-site-stream:

"I thought we had an agreement that parent Pom "api" changes was to at 
least be reviewed before applied."

And I agree with that. Therefore, to be able to move forward with the 
work I needed to do, I created this wrapper. The old one still works for 
Maven builds (but not for shell scripts). The new one works for both. 
Therefore the old (broken) API is respected and the new (better) API can 
be the way forward.

So, you were able to review, and I was able to verify my changes worked 
in Jenkins. It's a win-win, without delays!

"Why not just use the underscore form in the bash script?"

That's what I did. Renamed the variable in parent pom so I could reuse 
the same var across all jobs; had I not done that, we'd be passing 
jbosstools-site-stream to maven, and jbosstools_stream to bash, via two 
job parameters. Surely THAT would have been an ugly solution you would 
have reviewed and rejected?

Nick

On 03/13/2015 10:59 AM, Max Rydahl Andersen wrote:
> Why not just use the underscore form in the bash script that is said to be reduced/removed anyway and not have to do such sweeping changes in parent Pom and other locations just for what a bash script needs to do ? None of the poms will need to react/interact with the  variable as stored in the bash script.
>
> I see no value in introducing double the variables across parent Pom - we should be going towards *less* variations/duplications not more.
>
> Also I thought we had an agreement that parent Pom "api" changes was to at least be reviewed before applied - to reduce the amount of back and forth change in the part that potentially affects *all* projects.
>
> /max
> http://about.me/maxandersen
>
>
>> On 13 Mar 2015, at 05:33, Nick Boldt <nboldt at redhat.com> wrote:
>>
>> You can't do shell expansion of variables with dashes in the name.
>>
>> $ jbosstools-site-stream=4.3.mars
>> bash: jbosstools-site-stream=4.3.mars: command not found
>>
>> $ set jbosstools-site-stream=4.3.mars
>> $ echo ${jbosstools-site-stream}
>> site-stream
>>
>> $ export jbosstools-site-stream=4.3.mars
>> bash: export: `jbosstools-site-stream=4.3.mars': not a valid identifier
>>
>> More: http://unix.stackexchange.com/questions/23659/can-shell-variable-include-character
>>
>> So... it doesn't work.
>>
>> But if you prefer I can use jbosstools_site_stream instead of jbosstools_stream. Either way the old one is set to the new one [1] so that old jobs can keep using the deprecated one.
>>
>> [1] https://github.com/jbosstools/jbosstools-build/blob/master/parent/pom.xml#L75-L76
>>
>>
>>> On 03/12/2015 10:56 PM, Max Rydahl Andersen wrote:
>>> I just tried and I don't see any problems using x-y-z in neither Jenkins or scripts.
>>>
>>> Can you elaborate more please ?
>>>
>>> /max
>>> http://about.me/maxandersen
>>>
>>>
>>>> On 12 Mar 2015, at 14:20, Nick Boldt <nboldt at redhat.com> wrote:
>>>>
>>>> TL;DR:
>>>>
>>>> jbosstools-site-stream is now jbosstools_stream; if you use
>>>> jbosstools-site-stream, please update your poms/jobs for JBT 4.3/JBDS 9.
>>>>
>>>> ---
>>>>
>>>> I've had to rename the parent pom Maven variable
>>>> <jbosstools-site-stream> in order to reuse it in Jenkins job configs.
>>>> This allows us to override it in Jenkins AND use the same value in shell
>>>> scripts to define where content is published on the server, as per the
>>>> new reorg going on for JBT 4.3 / JBDS 9 [1].
>>>>
>>>> The new variable is jbosstools_stream; I intentionally renamed it rather
>>>> than just swapping dashes (not allowed in bash variables) for
>>>> underscores (allowed) so it would be more obvious.
>>>>
>>>> [1] https://issues.jboss.org/browse/JBDS-3208
>>>>
>>>> As far as I can tell, the only affected projects are:
>>>>
>>>> jbosstools-build [2]
>>>> jbosstools-central [3]
>>>> jbosstools-integration-tests [4]
>>>> jbdevstudio-product [5]
>>>>
>>>> [2] https://github.com/jbosstools/jbosstools-build/pull/178
>>>> [3] https://github.com/jbosstools/jbosstools-central/pull/325
>>>> [4] https://github.com/jbosstools/jbosstools-integration-tests/pull/884
>>>> [5] https://github.com/jbdevstudio/jbdevstudio-product/pull/280
>>>>
>>>> Note that the old variable is *still in the parent pom*, but it is now
>>>> deprecated & derived from the the new one [6].
>>>>
>>>> [6]
>>>> https://github.com/jbosstools/jbosstools-build/blob/master/parent/pom.xml#L75-L76
>>>>
>>>> --
>>>> Nick Boldt :: JBoss by Red Hat
>>>> Productization Lead :: JBoss Tools & Dev Studio
>>>> http://nick.divbyzero.com
>>>> _______________________________________________
>>>> jbosstools-dev mailing list
>>>> jbosstools-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/jbosstools-dev
>>
>> --
>> Nick Boldt :: JBoss by Red Hat
>> Productization Lead :: JBoss Tools & Dev Studio
>> http://nick.divbyzero.com

-- 
Nick Boldt :: JBoss by Red Hat
Productization Lead :: JBoss Tools & Dev Studio
http://nick.divbyzero.com


More information about the jbosstools-dev mailing list