Package hudson.plugins.git.util

Examples of hudson.plugins.git.util.BuildData


     * @param build
     * @return SHA1 of the las
     * @throws IOException Cannot get the info about commit ID
     */
    public static @Nonnull ObjectId getCommitSHA1(@Nonnull AbstractBuild<?, ?> build) throws IOException {
        BuildData buildData = build.getAction(BuildData.class);
        if (buildData == null) {
            throw new IOException(Messages.BuildDataHelper_NoBuildDataError());
        }
        final Revision lastBuildRevision = buildData.getLastBuiltRevision();
        final ObjectId sha1 = lastBuildRevision != null ? lastBuildRevision.getSha1() : null;
        if (sha1 == null) { // Nowhere to report => fail the build
            throw new IOException(Messages.BuildDataHelper_NoLastRevisionError());
        }
        return sha1;
View Full Code Here

TOP

Related Classes of hudson.plugins.git.util.BuildData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.