mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 07:36:01 +00:00
Add support for editing changelog
This commit is contained in:
1 parent
39424224a2
commit
6ea88548d7
2 files changed
+21
-1
No files matched your search
+1
-1
@@ -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
|
||||
|
||||
+20
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user