Search in sources :

Example 1 with ReleaseInfo

use of io.spring.concourse.releasescripts.ReleaseInfo in project spring-boot by spring-projects.

the class PublishToCentralCommand method run.

@Override
public void run(ApplicationArguments args) throws Exception {
    List<String> nonOptionArgs = args.getNonOptionArgs();
    Assert.state(nonOptionArgs.size() == 4, "Release type, build info location, or artifacts location not specified");
    String releaseType = nonOptionArgs.get(1);
    ReleaseType type = ReleaseType.from(releaseType);
    if (!ReleaseType.RELEASE.equals(type)) {
        return;
    }
    String buildInfoLocation = nonOptionArgs.get(2);
    logger.debug("Loading build-info from " + buildInfoLocation);
    byte[] content = Files.readAllBytes(new File(buildInfoLocation).toPath());
    BuildInfoResponse buildInfoResponse = this.objectMapper.readValue(content, BuildInfoResponse.class);
    BuildInfo buildInfo = buildInfoResponse.getBuildInfo();
    ReleaseInfo releaseInfo = ReleaseInfo.from(buildInfo);
    String artifactsLocation = nonOptionArgs.get(3);
    this.sonatype.publish(releaseInfo, new File(artifactsLocation).toPath());
}
Also used : ReleaseType(io.spring.concourse.releasescripts.ReleaseType) BuildInfo(io.spring.concourse.releasescripts.artifactory.payload.BuildInfoResponse.BuildInfo) ReleaseInfo(io.spring.concourse.releasescripts.ReleaseInfo) BuildInfoResponse(io.spring.concourse.releasescripts.artifactory.payload.BuildInfoResponse) File(java.io.File)

Example 2 with ReleaseInfo

use of io.spring.concourse.releasescripts.ReleaseInfo in project spring-boot by spring-projects.

the class ArtifactoryServiceTests method getReleaseInfo.

private ReleaseInfo getReleaseInfo() {
    ReleaseInfo releaseInfo = new ReleaseInfo();
    releaseInfo.setBuildName("example-build");
    releaseInfo.setBuildNumber("example-build-1");
    return releaseInfo;
}
Also used : ReleaseInfo(io.spring.concourse.releasescripts.ReleaseInfo)

Example 3 with ReleaseInfo

use of io.spring.concourse.releasescripts.ReleaseInfo in project spring-boot by spring-projects.

the class SonatypeServiceTests method getReleaseInfo.

private ReleaseInfo getReleaseInfo() {
    ReleaseInfo releaseInfo = new ReleaseInfo();
    releaseInfo.setBuildName("example-build");
    releaseInfo.setBuildNumber("example-build-1");
    releaseInfo.setVersion("1.1.0.RELEASE");
    releaseInfo.setGroupId("example");
    return releaseInfo;
}
Also used : ReleaseInfo(io.spring.concourse.releasescripts.ReleaseInfo)

Example 4 with ReleaseInfo

use of io.spring.concourse.releasescripts.ReleaseInfo in project spring-boot by spring-projects.

the class PromoteCommand method run.

@Override
public void run(ApplicationArguments args) throws Exception {
    logger.debug("Running 'promote' command");
    List<String> nonOptionArgs = args.getNonOptionArgs();
    Assert.state(!nonOptionArgs.isEmpty(), "No command argument specified");
    Assert.state(nonOptionArgs.size() == 3, "Release type or build info location not specified");
    String releaseType = nonOptionArgs.get(1);
    ReleaseType type = ReleaseType.from(releaseType);
    String buildInfoLocation = nonOptionArgs.get(2);
    byte[] content = Files.readAllBytes(new File(buildInfoLocation).toPath());
    BuildInfoResponse buildInfoResponse = this.objectMapper.readValue(new String(content), BuildInfoResponse.class);
    ReleaseInfo releaseInfo = ReleaseInfo.from(buildInfoResponse.getBuildInfo());
    this.service.promote(type.getRepo(), releaseInfo);
}
Also used : ReleaseType(io.spring.concourse.releasescripts.ReleaseType) ReleaseInfo(io.spring.concourse.releasescripts.ReleaseInfo) BuildInfoResponse(io.spring.concourse.releasescripts.artifactory.payload.BuildInfoResponse) File(java.io.File)

Aggregations

ReleaseInfo (io.spring.concourse.releasescripts.ReleaseInfo)4 ReleaseType (io.spring.concourse.releasescripts.ReleaseType)2 BuildInfoResponse (io.spring.concourse.releasescripts.artifactory.payload.BuildInfoResponse)2 File (java.io.File)2 BuildInfo (io.spring.concourse.releasescripts.artifactory.payload.BuildInfoResponse.BuildInfo)1