Am Montag, 23. Mai 2016, 11:28:57 schrieb Jesse Glick:
> On Sat, May 21, 2016 at 2:49 PM, Martin Weber <
fifteen...@gmail.com>
wrote:
> > for AbstractBuildS, my plugin [1] parses a generated file, grabs a
> > specific
> > value (usually /usr/bin/make on linux) from the file and exposes that
> > value as an environment variable named "CMAKE_BUILD_TOOL". This allows
> > users to reference the actual build tool in subsequent build steps that
> > execute shell scripts.
> >
> > Is there a way with pipeline to accomplish something similar?
Thank you for your explanation.
[...]
> Currently there is not a way for a `SimpleBuildStep` (non-block-scoped
> step) to add global environment variable definitions to Pipeline
> builds. I am hesitant to add one, since adjusting the build’s overall
> environment is hazardous when you are dealing with multiple nodes
> within one build: these variables are frequently specific to a single
> machine (and it sounds like `CMAKE_BUILD_TOOL` would fall into that
> category). Block-scoped steps more safely support complex builds such
> as
I wasn't aware the of the 'multiple nodes within one build' feature yet. Now I
totally agree, it would be hazardous to add `CMAKE_BUILD_TOOL` to global
environment. But adding it to a per-job/per-node environment would be fine,
but is there such an environment in jenkins?
Exporting `CMAKE_BUILD_TOOL` to global environment in a *freestyle* project is
just there to help solve some corner cases and allows users to call
"$CMAKE_BUILD_TOOL clean world" from a shell script.
But these cases are rare, since CmakePlugin itself can invoke
$CMAKE_BUILD_TOOL -- as a sub-step, without any shell.
See this the pipeline equivalent of './configure', 'make clean world',
'DESTDIR=${WORKSPACE}/artifacts/dir make install'
step([$class: 'CmakeBuilder',
buildDir: 'build',
buildType: 'Debug',
cleanBuild: true,
installationName: '3.5.2',
sourceDir: 'testprojects/C-subsrc/src',
steps: [
[args: 'clean world'],
[args: 'install', envVars: 'DESTDIR=${WORKSPACE}/artifacts/dir']
]
])
So I think the plugin`s help text should just mention that $CMAKE_BUILD_TOOL
is *not* available in *pipeline* jobs.
Martin