motto/build-container

27 lines
650 B
Text
Raw Normal View History

2024-09-23 17:19:51 +00:00
#!/usr/bin/env python3
import re
import subprocess
import sys
if len(sys.argv) < 2:
print("Must provide version string", file=sys.stderr)
exit(1)
version_pattern = re.compile(r"(\d+).(\d+).(\d+)")
version = version_pattern.match(sys.argv[1])
command = [
"podman",
"build",
"--tag", "forge.monodon.me/gnarwhal/motto:latest",
"--tag", f"forge.monodon.me/gnarwhal/motto:{version[1]}",
"--tag", f"forge.monodon.me/gnarwhal/motto:{version[1]}.{version[2]}",
"--tag", f"forge.monodon.me/gnarwhal/motto:{version[1]}.{version[2]}.{version[3]}",
"./",
]
print("Building:", " ".join(command))
subprocess.run(command)