Search in sources :

Example 1 with InternalBuildStatus

use of com.atlassian.stash.internal.build.InternalBuildStatus in project stashbot by palantir.

the class BuildSuccessReportingServlet method getSuccessStatus.

private BuildStatus getSuccessStatus(Repository repo, JobTemplate jt, State state, long buildNumber, String buildHead) throws SQLException {
    Date now = new Date(java.lang.System.currentTimeMillis());
    DateFormat df = DateFormat.getDateInstance();
    // key will be the jenkins name
    String key = jt.getBuildNameFor(repo);
    String name = key + " (build " + Long.toString(buildNumber) + ")";
    String description = "Build " + Long.toString(buildNumber) + " " + state.toString() + " at " + df.format(now);
    String url = getJenkinsUrl(repo, jt, buildNumber);
    BuildStatus bs = new InternalBuildStatus(state, name, name, url, description, now);
    return bs;
}
Also used : DateFormat(java.text.DateFormat) BuildStatus(com.atlassian.stash.build.BuildStatus) InternalBuildStatus(com.atlassian.stash.internal.build.InternalBuildStatus) Date(java.sql.Date) InternalBuildStatus(com.atlassian.stash.internal.build.InternalBuildStatus)

Aggregations

BuildStatus (com.atlassian.stash.build.BuildStatus)1 InternalBuildStatus (com.atlassian.stash.internal.build.InternalBuildStatus)1 Date (java.sql.Date)1 DateFormat (java.text.DateFormat)1