mirror of
https://github.com/spritsail/alpine.git
synced 2025-05-22 22:00:39 +00:00
Publish to Spritsail, Github and Docker container registries
Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
parent
ea70eddebd
commit
f987f60fff
18
.drone.star
18
.drone.star
@ -18,7 +18,7 @@ def main(ctx):
|
|||||||
depends_on.append(key)
|
depends_on.append(key)
|
||||||
|
|
||||||
if ctx.build.branch in branches:
|
if ctx.build.branch in branches:
|
||||||
builds.append(publish(ver, depends_on, tags))
|
builds.extend(publish(ver, depends_on, tags))
|
||||||
|
|
||||||
return builds
|
return builds
|
||||||
|
|
||||||
@ -71,9 +71,10 @@ def step(ver, arch, key):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def publish(ver, depends, tags=[]):
|
def publish(ver, depends, tags=[]):
|
||||||
return {
|
return [
|
||||||
|
{
|
||||||
"kind": "pipeline",
|
"kind": "pipeline",
|
||||||
"name": "publish-%s" % ver,
|
"name": "publish-%s-%s" % (ver, name),
|
||||||
"depends_on": depends,
|
"depends_on": depends,
|
||||||
"platform": {
|
"platform": {
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
@ -89,8 +90,9 @@ def publish(ver, depends, tags=[]):
|
|||||||
"settings": {
|
"settings": {
|
||||||
"src_registry": {"from_secret": "registry_url"},
|
"src_registry": {"from_secret": "registry_url"},
|
||||||
"src_login": {"from_secret": "registry_login"},
|
"src_login": {"from_secret": "registry_login"},
|
||||||
|
"dest_registry": registry,
|
||||||
"dest_repo": repo,
|
"dest_repo": repo,
|
||||||
"dest_login": {"from_secret": "docker_login"},
|
"dest_login": {"from_secret": login_secret},
|
||||||
"tags": [ver] + tags,
|
"tags": [ver] + tags,
|
||||||
},
|
},
|
||||||
"when": {
|
"when": {
|
||||||
@ -98,7 +100,13 @@ def publish(ver, depends, tags=[]):
|
|||||||
"event": ["push", "cron"],
|
"event": ["push", "cron"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
}
|
}
|
||||||
|
for name, registry, login_secret in [
|
||||||
|
("dockerhub", "index.docker.io", "docker_login"),
|
||||||
|
("spritsail", "registry.spritsail.io", "spritsail_login"),
|
||||||
|
("ghcr", "ghcr.io", "ghcr_login"),
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
# vim: ft=python sw=2
|
# vim: ft=python sw=2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user