26 lines
650 B
Python
Executable file
26 lines
650 B
Python
Executable file
#!/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)
|
|
|