当前位置: 首页>>代码示例>>Java>>正文


Java SRunningBuild.getBuildNumber方法代码示例

本文整理汇总了Java中jetbrains.buildServer.serverSide.SRunningBuild.getBuildNumber方法的典型用法代码示例。如果您正苦于以下问题:Java SRunningBuild.getBuildNumber方法的具体用法?Java SRunningBuild.getBuildNumber怎么用?Java SRunningBuild.getBuildNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jetbrains.buildServer.serverSide.SRunningBuild的用法示例。


在下文中一共展示了SRunningBuild.getBuildNumber方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: storeBuildNumberInSauce

import jetbrains.buildServer.serverSide.SRunningBuild; //导入方法依赖的package包/类
/**
 * Invokes the Sauce REST API to store the TeamCity build number and pass/fail status within
 * Sauce.
 * @param build
 * @param sessionId
 */
private void storeBuildNumberInSauce(SRunningBuild build, String sessionId) {
    Collection<SBuildFeatureDescriptor> features = build.getBuildType().getBuildFeatures();
    if (features.isEmpty()) return;
    for (SBuildFeatureDescriptor feature : features) {
        if (feature.getType().equals("sauce")) {
            SauceREST sauceREST = new SauceREST(getUsername(feature), getAccessKey(feature));
            Map<String, Object> updates = new HashMap<String, Object>();
            try {
                String json = sauceREST.getJobInfo(sessionId);
                JSONObject jsonObject = (JSONObject) new JSONParser().parse(json);
                String buildNumber = build.getBuildTypeExternalId() + build.getBuildNumber();
                logger.info("Setting build number " + buildNumber + " for job " + sessionId + " user: " + getUsername(feature));
                updates.put("build", buildNumber);
                if (jsonObject.get("passed") == null || jsonObject.get("passed").equals("")) {
                    if (build.getStatusDescriptor().getStatus().isSuccessful()) {
                        updates.put("passed", Boolean.TRUE.toString());
                    } else if (build.getStatusDescriptor().getStatus().isFailed()) {
                        updates.put("passed", Boolean.FALSE.toString());
                    }
                }

                sauceREST.updateJobInfo(sessionId, updates);
            } catch (org.json.simple.parser.ParseException e) {
                logger.error("Failed to parse JSON for session id: " + sessionId + " user: " + getUsername(feature), e);
            }
        }
    }
}
 
开发者ID:rossrowe,项目名称:sauce-teamcity-plugin,代码行数:35,代码来源:SauceServerAdapter.java

示例2: notifyBuildSuccessful

import jetbrains.buildServer.serverSide.SRunningBuild; //导入方法依赖的package包/类
@Override
public void notifyBuildSuccessful(@NotNull SRunningBuild build, @NotNull Set<SUser> users) {
    String message = "**#" + build.getBuildNumber() + " " + build.getFullName() + " (`" + getBranchName(build.getBranch()) + "`) Successful**";
    doNotify(message, users);
}
 
开发者ID:dsaved,项目名称:africhat-platform-0.1,代码行数:6,代码来源:ActorNotifier.java

示例3: notifyBuildStarted

import jetbrains.buildServer.serverSide.SRunningBuild; //导入方法依赖的package包/类
@Override
public void notifyBuildStarted(@NotNull SRunningBuild build, @NotNull Set<SUser> users) {
    String message = " #" + build.getBuildNumber() + " " + build.getFullName() + " (`" + getBranchName(build.getBranch()) + "`) Started";
    doNotify(message, users);
}
 
开发者ID:dsaved,项目名称:africhat-platform-0.1,代码行数:6,代码来源:ActorNotifier.java

示例4: notifyBuildFailed

import jetbrains.buildServer.serverSide.SRunningBuild; //导入方法依赖的package包/类
@Override
public void notifyBuildFailed(@NotNull SRunningBuild build, @NotNull Set<SUser> users) {
    String message = "**#" + build.getBuildNumber() + " " + build.getFullName() + " (`" + getBranchName(build.getBranch()) + "`) Failed**";
    doNotify(message, users);
}
 
开发者ID:dsaved,项目名称:africhat-platform-0.1,代码行数:6,代码来源:ActorNotifier.java

示例5: notifyBuildFailing

import jetbrains.buildServer.serverSide.SRunningBuild; //导入方法依赖的package包/类
@Override
public void notifyBuildFailing(@NotNull SRunningBuild build, @NotNull Set<SUser> users) {
    String message = "**#" + build.getBuildNumber() + " " + build.getFullName() + " (`" + getBranchName(build.getBranch()) + "`) Failing**";
    doNotify(message, users);
}
 
开发者ID:dsaved,项目名称:africhat-platform-0.1,代码行数:6,代码来源:ActorNotifier.java

示例6: notifyBuildFailedToStart

import jetbrains.buildServer.serverSide.SRunningBuild; //导入方法依赖的package包/类
@Override
public void notifyBuildFailedToStart(@NotNull SRunningBuild build, @NotNull Set<SUser> users) {
    String message = "**#" + build.getBuildNumber() + " " + build.getFullName() + " (`" + getBranchName(build.getBranch()) + "`) Failed To Start**";
    doNotify(message, users);
}
 
开发者ID:dsaved,项目名称:africhat-platform-0.1,代码行数:6,代码来源:ActorNotifier.java


注:本文中的jetbrains.buildServer.serverSide.SRunningBuild.getBuildNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。