Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downstream job unable to access default jenkins variable #228

Open
ghost opened this issue Mar 11, 2016 · 2 comments
Open

downstream job unable to access default jenkins variable #228

ghost opened this issue Mar 11, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 11, 2016

Downstream job is not able access BUILD_NUMBER from default JenkinsSetEnvironmentVariables

Based on the following .ci.yml

plugins:
  - downstream_job:
      on_result: SUCCESS
      foo/bar:
        VERSION: <% out<< printf("%06d", BUILD_NUMBER.toInteger()) << "-" << DOTCI_SHA.substring(0,10) %>
        BRANCH: master

Resulted in null per attached output from foo/bar

screen shot 2016-03-11 at 4 29 46 pm

Aside from groovy script, I don't see any way to compute values to pass dynamic variable to build parameters since bash commands will not work outside of the build run section.

@ghost ghost changed the title downstream job unable to access jenkins variable downstream job unable to access default jenkins variable Mar 11, 2016
@ghost
Copy link
Author

ghost commented Apr 12, 2016

Also confirmed Downstream job is not able to pass the default String Parameter values that a job may have configured ...

For example job/foo/job/bar/configured with IMAGE default as "mysql" and TAG default as "5.7"
screen shot 2016-04-12 at 12 45 38 pm

but its invocation via downstream results in the following console error output

$ docker pull $IMAGE:$TAG

instead of the following console output when invoked manually (i.e. not downstream job)

$ docker pull mysql:5.7

@raulvc
Copy link

raulvc commented Dec 28, 2016

sorry for bringing this back from the shadows, have you found a way to work around this issue?

I stumbled upon this because I have to dynamically generate a var in a build and pass it to the downstream job (unfortunately I can't directly use the parameterized trigger build plugin for this purpose)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant