Skip to content

Commit

Permalink
Merge pull request #11 from ybonnel/master
Browse files Browse the repository at this point in the history
[FIXES JENKINS-8152] Adds PROMOTED_<scm stuff> variables for SCM information
  • Loading branch information
stigkj committed Feb 8, 2012
2 parents 61325dd + fe363e3 commit 9b79be8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/hudson/plugins/promoted_builds/Promotion.java
Expand Up @@ -21,6 +21,7 @@
import java.io.IOException;
import java.util.Calendar;
import java.util.List;
import java.util.Map.Entry;

/**
* Records a promotion process.
Expand Down Expand Up @@ -83,6 +84,12 @@ public EnvVars getEnvironment(TaskListener listener) throws IOException, Interru
e.put("PROMOTED_JOB_NAME", target.getParent().getName());
e.put("PROMOTED_NUMBER", Integer.toString(target.getNumber()));
e.put("PROMOTED_ID", target.getId());
EnvVars envScm = new EnvVars();
target.getProject().getScm().buildEnvVars( target, envScm );
for ( Entry<String, String> entry : envScm.entrySet() )
{
e.put( "PROMOTED_" + entry.getKey(), entry.getValue() );
}

// Allow the promotion status to contribute to build environment
getStatus().buildEnvVars(this, e);
Expand Down

1 comment on commit 9b79be8

@stigkj
Copy link
Member Author

@stigkj stigkj commented on 9b79be8 Feb 8, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, copy/paste error re which JIRA this fixes, it should be JENKINS-9743

Please sign in to comment.