diff --git a/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/ReleaserApplication.java b/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/ReleaserApplication.java index c2dec091..02cfdc2e 100644 --- a/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/ReleaserApplication.java +++ b/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/ReleaserApplication.java @@ -70,6 +70,7 @@ public class ReleaserApplication implements CommandLineRunner { throw th; } } + handleStableBuild(); System.exit(0); } @@ -81,11 +82,11 @@ public class ReleaserApplication implements CommandLineRunner { "[BUILD UNSTABLE] The release happened successfully, but there were post release issues"); log.error("[BUILD UNSTABLE] An exception that should make " + "the build unstable occurred. Will not throw an exception."); - File buildUnstable = new File("build_unstable"); + File buildStatus = new File("build_status"); try { - buildUnstable.createNewFile(); + buildStatus.createNewFile(); String text = "[BUILD UNSTABLE] The release happened successfully, but there were post release issues"; - Files.write(buildUnstable.toPath(), text.getBytes()); + Files.write(buildStatus.toPath(), text.getBytes()); } catch (IOException e) { throw new IllegalStateException( @@ -93,4 +94,20 @@ public class ReleaserApplication implements CommandLineRunner { } } + private void handleStableBuild() { + File buildStatus = new File("build_status"); + if (buildStatus.exists()) { + log.info("Build status file has already been created!"); + return; + } + try { + buildStatus.createNewFile(); + String text = "[BUILD STABLE] All the release steps have been successfully executed!"; + Files.write(buildStatus.toPath(), text.getBytes()); + } + catch (IOException e) { + log.info("Failed to store the file but the build was stable"); + } + } + }