37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
import json
|
|
|
|
import yaml
|
|
|
|
with open("images.json", "r") as f:
|
|
images_data = json.load(f)
|
|
|
|
with open(".woodpecker/build.yaml", "w") as f:
|
|
f.write("# GENERATED CODE - DO NOT MODIFY BY HAND\n")
|
|
yaml.dump(
|
|
{
|
|
"when": [
|
|
{"event": "push", "branch": "${CI_REPO_DEFAULT_BRANCH}"},
|
|
{"event": "manual"},
|
|
{"event": "cron", "cron": "weekly"},
|
|
],
|
|
"steps": [
|
|
{
|
|
"name": f"publish {image['name']}",
|
|
"image": "woodpeckerci/plugin-docker-buildx",
|
|
"settings": {
|
|
"repo": f"git.jakew.me/${{CI_REPO_OWNER}}/{image['name']}",
|
|
"registry": "git.jakew.me",
|
|
"dockerfile": image["dockerfile"],
|
|
"platforms": "linux/amd64,linux/arm64",
|
|
"tags": "latest",
|
|
"username": "${CI_REPO_OWNER}",
|
|
"password": {"from_secret": "docker_token"},
|
|
},
|
|
"directory": image["context"],
|
|
}
|
|
for image in images_data
|
|
],
|
|
},
|
|
f,
|
|
default_flow_style=False,
|
|
)
|