2020-01-05 17:38:30 +00:00
|
|
|
def main(ctx):
|
2020-01-05 17:38:30 +00:00
|
|
|
versions = [
|
|
|
|
["3.9",[]],
|
|
|
|
["3.10",[]],
|
|
|
|
["3.11", ["latest"]],
|
|
|
|
["edge", []],
|
2020-01-05 18:36:41 +00:00
|
|
|
["chrislane", ["😍"]],
|
2020-01-05 17:38:30 +00:00
|
|
|
]
|
2020-01-05 17:38:30 +00:00
|
|
|
return [step(v[0], v[1]) for v in versions] + [notify(["build-%s" % v for v, _ in versions])]
|
2020-01-05 17:38:30 +00:00
|
|
|
|
|
|
|
def step(alpinever,tags=[]):
|
|
|
|
return {
|
|
|
|
"kind": "pipeline",
|
|
|
|
"name": "build-%s" % alpinever,
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"name": "build",
|
|
|
|
"image": "spritsail/docker-build",
|
|
|
|
"pull": "always",
|
|
|
|
"settings": {
|
|
|
|
"repo": "alpine-dev-%s" % alpinever,
|
|
|
|
"build_args": [
|
|
|
|
"ALPINE_TAG=%s" % alpinever,
|
2020-01-05 17:38:30 +00:00
|
|
|
],
|
|
|
|
},
|
2020-01-05 17:38:30 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "test",
|
|
|
|
"image": "spritsail/docker-test",
|
|
|
|
"pull": "always",
|
|
|
|
"settings": {
|
|
|
|
"repo": "spritsail/alpine",
|
|
|
|
"run": "su-exec nobody apk --version",
|
2020-01-05 17:38:30 +00:00
|
|
|
},
|
2020-01-05 17:38:30 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "publish",
|
|
|
|
"image": "spritsail/docker-publish",
|
|
|
|
"pull": "always",
|
|
|
|
"settings": {
|
|
|
|
"from": "alpine-dev-%s" % alpinever,
|
|
|
|
"repo": "spritsail/alpine",
|
|
|
|
"tags": [alpinever] + tags,
|
|
|
|
},
|
|
|
|
"environment": {
|
|
|
|
"DOCKER_USERNAME": {
|
|
|
|
"from_secret": "docker_username",
|
|
|
|
},
|
|
|
|
"DOCKER_PASSWORD": {
|
|
|
|
"from_secret": "docker_password",
|
2020-01-05 17:38:30 +00:00
|
|
|
},
|
2020-01-05 17:38:30 +00:00
|
|
|
},
|
|
|
|
"when": {
|
|
|
|
"branch": ["master"],
|
|
|
|
"event": ["push"],
|
2020-01-05 17:38:30 +00:00
|
|
|
},
|
|
|
|
},
|
2020-01-05 17:38:30 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2020-01-05 17:38:30 +00:00
|
|
|
def notify(versions):
|
|
|
|
return {
|
|
|
|
"kind": "pipeline",
|
|
|
|
"name": "notify",
|
|
|
|
"depends_on": versions,
|
2020-01-05 19:25:30 +00:00
|
|
|
"when": {
|
|
|
|
"status": [ "success", "failure" ],
|
|
|
|
},
|
2020-01-05 17:38:30 +00:00
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"name": "notify",
|
|
|
|
"image": "spritsail/notify",
|
|
|
|
"environment": {
|
|
|
|
"WEBHOOK_URL": {
|
|
|
|
"from_secret": "webhook_url",
|
|
|
|
},
|
|
|
|
"NOTIFY_TOKEN": {
|
|
|
|
"from_secret": "notify_token",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|