builder: rework OS names for consistency

This commit is contained in:
Davide Cavalca 2023-05-09 09:58:00 -07:00
parent 14652d47d2
commit 9d9b6b5b75

View File

@ -22,26 +22,32 @@ RELEASE = os.getenv("FEDORA_RELEASE")
if not RELEASE: if not RELEASE:
fail("FEDORA_RELEASE is not defined in your environment, aborting") fail("FEDORA_RELEASE is not defined in your environment, aborting")
TODAY = date.today().strftime("%Y%m%d")
# TODO: should be a class using abc # TODO: should be a class using abc
TARGETS = { TARGETS = {
"kde": { "kde": {
"profile": "Workstation-KDE", "profile": "Workstation-KDE",
"name": f"Fedora Linux {RELEASE} KDE Plasma", "name": f"Fedora Linux {RELEASE} with KDE Plasma ({TODAY})",
"os_name": "Fedora Linux with KDE Plasma",
"id": "kde", "id": "kde",
}, },
"gnome": { "gnome": {
"profile": "Workstation-GNOME", "profile": "Workstation-GNOME",
"name": f"Fedora Linux {RELEASE} GNOME", "name": f"Fedora Linux {RELEASE} with GNOME ({TODAY})",
"os_name": "Fedora Linux with GNOME",
"id": "gnome", "id": "gnome",
}, },
"server": { "server": {
"profile": "Server", "profile": "Server",
"name": f"Fedora Linux {RELEASE} Server", "name": f"Fedora Linux {RELEASE} Server ({TODAY})",
"os_name": "Fedora Linux Server",
"id": "server", "id": "server",
}, },
"minimal": { "minimal": {
"profile": "Minimal", "profile": "Minimal",
"name": f"Fedora Linux {RELEASE} Minimal", "name": f"Fedora Linux {RELEASE} Minimal ({TODAY})",
"os_name": "Fedora Linux Minimal",
"id": "minimal", "id": "minimal",
}, },
} }
@ -114,15 +120,14 @@ def kiwiBuild(profile):
def packageBuild(target): def packageBuild(target):
# TODO: rewrite in python instead of shelling out # TODO: rewrite in python instead of shelling out
runCommand(["./make-asahi-installer-package.sh"]) runCommand(["./make-asahi-installer-package.sh"])
today = date.today().strftime("%Y%m%d")
package = f"fedora-{RELEASE}-{target['id']}-{today}.zip" package = f"fedora-{RELEASE}-{target['id']}-{TODAY}.zip"
os.rename(f"fedora-{RELEASE}-{today}.zip", package) os.rename(f"fedora-{RELEASE}-{TODAY}.zip", package)
with open("installer_data.json", "r") as f: with open("installer_data.json", "r") as f:
data = json.load(f) data = json.load(f)
data["os_list"][0]["name"] = f"{target['name']} ({today})" data["os_list"][0]["name"] = target["name"]
data["os_list"][0]["default_os_name"] = target["name"] data["os_list"][0]["default_os_name"] = target["os_name"]
data["os_list"][0]["package"] = package data["os_list"][0]["package"] = package
with open("installer_data.json", "w") as f: with open("installer_data.json", "w") as f:
@ -148,8 +153,7 @@ def invalidateCF(path):
def packageUpload(target): def packageUpload(target):
today = date.today().strftime("%Y%m%d") package = f"fedora-{RELEASE}-{target['id']}-{TODAY}.zip"
package = f"fedora-{RELEASE}-{target['id']}-{today}.zip"
uploadToS3(package, f"os/{package}") uploadToS3(package, f"os/{package}")