Upload all versions

This commit is contained in:
Greg Hellings
2023-08-12 17:28:31 -05:00
parent 9577e133eb
commit 9afb5f2c8d
2 changed files with 15 additions and 6 deletions
+14 -5
View File
@@ -4,6 +4,7 @@ from pathlib import Path
import sys import sys
sys.path.append(str(Path(__file__).parent / "lib")) sys.path.append(str(Path(__file__).parent / "lib"))
from support import Support, BASE from support import Support, BASE
import time
support = Support() support = Support()
@@ -17,6 +18,10 @@ parser.add_argument("--upload", "-u", help="Force doing uploads", action="store_
parser.add_argument("--headless", help="Run builds headless", action="store_true") parser.add_argument("--headless", help="Run builds headless", action="store_true")
args = parser.parse_args() args = parser.parse_args()
year, month, day, hour, minute, second, wday, jday, dst = time.localtime()
STAMP = f"build={year}.{month}.{day}.{hour}"
# Now provide menus if we don't have defaults # Now provide menus if we don't have defaults
def process_all(): def process_all():
if args.distro: if args.distro:
@@ -41,15 +46,19 @@ def process_builds(builds):
do_build(build) do_build(build)
def do_build(build): def do_build(build):
if args.upload:
upload = ""
else:
upload = "-except=upload"
if args.headless: if args.headless:
headless = "headless=true" headless = "headless=true"
else: else:
headless = "headless=false" headless = "headless=false"
packer build -var @(headless) @(build.var_file) @(build.only) @(upload) @(BASE / "sources")
if args.upload:
if "VAGRANT_CLOUD_TOKEN" not in ${...}:
print("You need to set your cloud token")
sys.exit(1)
packer build -var @(headless) -var @(STAMP) @(build.var_file) @(build.only) @(BASE / "sources")
else:
upload = "-except=upload"
packer build -var @(headless) -var @(STAMP) @(build.var_file) @(build.only) -except=upload @(BASE / "sources")
if args.all or (args.distro and args.version and args.build): if args.all or (args.distro and args.version and args.build):
process_all() process_all()
+1 -1
View File
@@ -6,7 +6,7 @@ variable "qemu_accelerator" {
source "qemu" "x86_64" { source "qemu" "x86_64" {
iso_url = var.iso.url iso_url = var.iso.url
iso_checksum = var.iso.checksum iso_checksum = var.iso.checksum
output_directory = "output_qemu_${local.name}" output_directory = "output/libvirt/${local.name}"
boot_command = var.boot_command boot_command = var.boot_command
shutdown_command = var.shutdown_command shutdown_command = var.shutdown_command