-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrebuild_all.py
23 lines (22 loc) · 883 Bytes
/
rebuild_all.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import subprocess
import requests
releases = requests.get(
'https://api.github.com/repos/Anuken/Mindustry/releases').json()
for index, realease in enumerate(releases[::-1]):
tag_name = realease["tag_name"]
ext_tag = ''
if index == len(releases) - 1:
ext_tag += "-t oldshensheep/mindustry-server:latest -t ghcr.io/oldshensheep/mindustry-server:latest \\"
if realease['prerelease'] == False:
ext_tag += "-t oldshensheep/mindustry-server:stable -t ghcr.io/oldshensheep/mindustry-server:stable \\"
call_str = f'''
docker buildx build \\
--push \\
--platform linux/arm,linux/arm64,linux/amd64 \\
-t oldshensheep/mindustry-server:{tag_name} \\
-t ghcr.io/oldshensheep/mindustry-server:{tag_name} \\
{ext_tag} \\
--build-arg "tag_name"="{tag_name}" .
'''
print(call_str)
subprocess.call(call_str, shell=True)