當前位置: 首頁>>代碼示例>>Java>>正文


Java Run.addAction方法代碼示例

本文整理匯總了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
}
 
開發者ID:Argelbargel,項目名稱:gitlab-branch-source-plugin,代碼行數:24,代碼來源:GitLabSCMMergeRequestHead.java

示例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()));
        }
    }
 
開發者ID:jenkinsci,項目名稱:azure-cli-plugin,代碼行數:9,代碼來源:Utils.java

示例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);
    }
}
 
開發者ID:Argelbargel,項目名稱:gitlab-branch-source-plugin,代碼行數:10,代碼來源:GitLabSCMPublishAction.java


注:本文中的hudson.model.Run.addAction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。