Friday, 15 February 2013

linux - Make Jenkins metadata available for projects -



linux - Make Jenkins metadata available for projects -

i've set jenkins server + metadata plugin (https://wiki.jenkins-ci.org/display/jenkins/metadata+plugin).

i'm having problem understanding how metadata can used in projects. i've added keys default values (e.g. some_metadata_key, default value foo string) using jenkins -> metadataconfiguration page. expose environment checked.

now, if create new project, in "meta data" section can see some_metadata_key preset value.

how can utilize ? want end in build environment; running shell script env doesn't show variable.

in project, i've tried:

created new string value same name predefined variable, no value set (i hoping predefined value default) --> fail, variable not set @ all.

create new string value different name (i.e. some_foobar_key) , value of $some_metadata_key --> fail, variable has value of "$some_metadata_key" instead of foo

my goal able define "global" values in single place , have them available multiple projects evironment variables.

metadata weird. if you're expecting utilize global environment variable, it's not going behave way want.

from metadata plugin page:

we differentiate between metadatadefinitions , metadatavalues. thought comes parameter setup in jenkins. metadatavalue what's set on configuration page of project or slave , saved build.

metadatadefinitions used admins making sure metadata exist on projects. metadatadefinition set through special configuration page, configuring name , default value definition. 1 time set, metadatadefinition end in projects on server, prompting user set value when project configured. metadatadefinitions converted metadatavalues.

as understand it, have metadata definition (from global metadata configuration) , need alter metadata value it's available in project.

the rules how definitions converted values not explained. in experience, editing project's configuration , selecting or editing specific preset value seems import definition project value. so, if follow these steps, can see metadata in project's build environment:

define key (my_key) , value in global metadata configuration, create sure expose environment checked. edit project's configuration. metadata key , default value should appear under presets. select or edit value of preset want "import" project. save. run build , check environment md_my_key.

based on of this, i'd concerned trying utilize value in global definition across many projects. suspect project's value may divorced global definition value when project converts definition value. metadata documentation implies definitions making sure metadata exists on projects, not managing same values across projects.

linux jenkins jenkins-plugins

No comments:

Post a Comment