Add script to build container
This commit is contained in:
parent
3b4d483c4b
commit
fdae644eb2
1 changed files with 26 additions and 0 deletions
26
build-container
Executable file
26
build-container
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/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)
|
||||||
|
|
Loading…
Reference in a new issue