本文整理匯總了Java中hudson.model.Run.addAction方法的典型用法代碼示例。如果您正苦於以下問題:Java Run.addAction方法的具體用法?Java Run.addAction怎麽用?Java Run.addAction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類hudson.model.Run
的用法示例。
在下文中一共展示了Run.addAction方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: decorateRevisionToBuild
import hudson.model.Run; //導入方法依賴的package包/類
@Override
public Revision decorateRevisionToBuild(GitSCM scm, Run<?, ?> build, GitClient git, TaskListener listener, Revision marked, Revision rev) throws IOException, InterruptedException, GitException {
listener.getLogger().println("Merging " + targetBranch.getName() + " commit " + targetBranch.getRevision().getHash() + " into merge-request head commit " + rev.getSha1String());
checkout(scm, build, git, listener, rev);
try {
git.setAuthor("Jenkins", /* could parse out of JenkinsLocationConfiguration.get().getAdminAddress() but seems overkill */"[email protected]");
git.setCommitter("Jenkins", "[email protected]");
MergeCommand cmd = git.merge().setRevisionToMerge(ObjectId.fromString(targetBranch.getRevision().getHash()));
for (GitSCMExtension ext : scm.getExtensions()) {
// By default we do a regular merge, allowing it to fast-forward.
ext.decorateMergeCommand(scm, build, git, listener, cmd);
}
cmd.execute();
} catch (GitException e) {
// Try to revert merge conflict markers.
checkout(scm, build, git, listener, rev);
throw e;
}
build.addAction(new MergeRecord(targetBranch.getRefSpec().destinationRef(targetBranch.getName()), targetBranch.getRevision().getHash())); // does not seem to be used, but just in case
ObjectId mergeRev = git.revParse(Constants.HEAD);
listener.getLogger().println("Merge succeeded, producing " + mergeRev.name());
return new Revision(mergeRev, rev.getBranches()); // note that this ensures Build.revision != Build.marked
}
示例2: setEnvironmentVariables
import hudson.model.Run; //導入方法依賴的package包/類
public static void setEnvironmentVariables(Run<?, ?> build, HashMap<String, String> environmentVariables) {
for (Map.Entry<String, String> var
:
environmentVariables.entrySet()) {
build.addAction(new PublishEnvVarAction(var.getKey(), var.getValue()));
}
}
示例3: publishStarted
import hudson.model.Run; //導入方法依賴的package包/類
public void publishStarted(Run<?, ?> build, GitLabSCMHeadMetadataAction metadata, String description) {
if (build instanceof WorkflowRun && mode == stages) {
attachGraphListener((WorkflowRun) build, new GitLabSCMGraphListener(build, metadata));
} else if (mode == result) {
String context = Messages.GitLabSCMPublishAction_DefaultContext(build.getNumber());
build.addAction(new RunningContextsAction(context));
publishBuildStatus(build, metadata, running, context, description);
}
}