use of io.spring.concourse.releasescripts.ReleaseType in project spring-boot by spring-projects.
the class PublishToSdkmanCommand method run.
@Override
public void run(ApplicationArguments args) throws Exception {
logger.debug("Running 'push to SDKMAN' command");
List<String> nonOptionArgs = args.getNonOptionArgs();
Assert.state(!nonOptionArgs.isEmpty(), "No command argument specified");
Assert.state(nonOptionArgs.size() >= 3, "Release type or version not specified");
String releaseType = nonOptionArgs.get(1);
ReleaseType type = ReleaseType.from(releaseType);
if (!ReleaseType.RELEASE.equals(type)) {
return;
}
String version = nonOptionArgs.get(2);
boolean makeDefault = false;
if (nonOptionArgs.size() == 4) {
makeDefault = Boolean.parseBoolean(nonOptionArgs.get(3));
}
this.service.publish(version, makeDefault);
}
use of io.spring.concourse.releasescripts.ReleaseType 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());
}
use of io.spring.concourse.releasescripts.ReleaseType 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);
}
Aggregations