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

[JENKINS-16028] [JENKINS-18762] Adds EnvAction when it's needed #47

Merged

Conversation

Projects
None yet
2 participants
@ikedam
Copy link
Member

ikedam commented Oct 2, 2014

JENKINS-16028
JENKINS-18762

Copyartifact provides an environment variable "COPYARTIFACT_BUILD_NUMBER_XXXX" which indicates the build number of the build from which copyartifacts copied artifacts.
That variable is bound to the build using CopyArtifact.EnvAction.

CopyArtifact.EnvAction is added to a build when the build starts and if the build has CopyArtifact among its builders. (this is done in CopyArtifact.CopyArtifactRunListener)
This results following problems:

  • Doesn't work for maven-projects as maven-projects uses copyartifact not as a builder but a pre-builder (which is unique attributes for maven-projects) and CopyArtifact.CopyArtifactRunListener fails to find CopyArtifact.
  • Doesn't work if copyartifact is wrapped in Conditional Buildstep as CopyArtifact.CopyArtifactRunListener fails to find CopyArtifact wrapped in another plugin.

This change makes copyartifact add CopyArtifact.EnvAction when it's needed, which should work correct also for above cases.

ikedam added some commits Oct 1, 2014

[JENKINS-16028] [JENKINS-18762] Added tests to reproduce JENKINS-1602…
…8 (environment variables are not set in maven prebuild), JENKINS-18762 (environment variables are not set when wrapped in another builder).
[FIXED JENKINS-16028] [FIXED JENKINS-18762] Adds EnvAction to hold CO…
…PYARTIFACT_BUILD_NUMBER_XXX when it's needed. It was added when a build starts and the build has copyartifact, which doesn't work for maven-project and copyartifacts wrapped in other builders.
@ikedam

This comment has been minimized.

Copy link
Member Author

ikedam commented Oct 2, 2014

@jglick @daniel-beck
Could you review this change?

Though I believe this works perfect, I might miss some cases this can cause a regression.

(I think you know well copyartifact and ways to handle Actions)

@jenkinsadmin

This comment has been minimized.

Copy link
Member

jenkinsadmin commented Oct 2, 2014

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

ikedam added a commit that referenced this pull request Oct 11, 2014

Merge pull request #47 from ikedam/feature/JENKINS-16028_EnvActionWhe…
…nNeeded

[JENKINS-16028] [JENKINS-18762] Adds EnvAction when it's needed

@ikedam ikedam merged commit c11b826 into jenkinsci:master Oct 11, 2014

1 check passed

default This pull request looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.