From 6ea88548d7a2ffe1ee7e437dbffe7ebf8806618b Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Sun, 17 Mar 2019 18:15:04 -0600 Subject: [PATCH] Add support for editing changelog --- Dockerfile | 2 +- release.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 38f4d953a..a4630602c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM openjdk:8-jdk-slim -RUN apt-get update && apt-get install -y python3-requests make git +RUN apt-get update && apt-get install -y python3-requests make git vim # Caching step; ForgeGradle requires a fairly significant number # of downloads that don't vary unless build.gradle changes. We diff --git a/release.py b/release.py index f837050df..cb7639b2a 100644 --- a/release.py +++ b/release.py @@ -41,6 +41,11 @@ def runNoOutput(cmd): else: return process.returncode +def runVim(filename): + process = subprocess.Popen(["vim", filename]) + (_output, err) = process.communicate() + return err + # Uploading to CF requires a API token (CF_API_TOKEN) apiToken = os.getenv("CF_API_TOKEN") if apiToken == None or len(apiToken) < 1: @@ -93,6 +98,21 @@ if err != None: print("Failed to get changelog for %s -> %s" % (lastTag, args.tag)) sys.exit(1) +# Dump the changelog into a temporary file +with open("/tmp/changelog.tmp", "w") as f: + f.write(changelog) + +# Open up Vim with the temporary file for editing +res = runVim("/tmp/changelog.tmp") +if res != None: + print("VIM result: " + res) + sys.exit(1) + +# Read the changelog +with open("/tmp/changelog.tmp", "r") as f: + changelog = "".join(f.readlines()) + print(changelog) + # Do the actual build err = runNoOutput(["./gradlew", "-Pversion=" + args.tag, "clean", "build"]) if err != None: