Feature #271

build-generator does not evaluate environment variables

Added by Florian Lier over 10 years ago. Updated over 10 years ago.

Status:RejectedStart date:2014-06-12
Priority:HighDue date:
Assignee:Jan Moringen% Done:

0%

Category:build-generatorSpent time:-
Target version:Toolkit 0.1

Description

Based on the first beta tests, people tried to do the following:

export prefix=/tmp/
$prefix/jenkins/job-configurator --on-error=continue -b http://localhost:8080 -d $prefix/dist/distributions/DESIRED_DISTRIBUTION.distribution -t '$prefix/dist/templates/*.template'

This does not work, however, this is clearly also dependent on the quality of the provided tutorial. However, I believe
it's a good idea to enable the build-generator to make use of environment variables.

History

#1 Updated by Florian Lier over 10 years ago

  • Subject changed from build-generator does not understand environment variables to build-generator does not evaluate environment variables

#2 Updated by Florian Lier over 10 years ago

  • Description updated (diff)

#3 Updated by Jan Moringen over 10 years ago

  • Status changed from New to Rejected

To make sure we are on the same page w.r.t. how this happens: In the provided example

export prefix=/tmp/
$prefix/jenkins/job-configurator --on-error=continue -b http://localhost:8080 -d $prefix/dist/distributions/DESIRED_DISTRIBUTION.distribution -t '$prefix/dist/templates/*.template'

the part '$prefix/dist/templates/*.template' is protected from expansion by the shell because of the single quotes. As a result, the generator sees the commandline option string $prefix/dist/templates/*.template. It applies a kind of globbing which can expand the *.template part, but it does not expand environment variables.

That said, I don't think it makes sense to implement expansion of environment variables in the build-generator.

Providing this feature for commandline arguments would add little value and the same result can be trivially achieved using the shell. In the above example, $prefix/dist/templates/'*.template' would suffice.

Providing this feature for recipes would even be slightly dangerous because recipes would be less self-contained (I'm not sure whether this is suggested by this issue).

Also available in: Atom PDF