ocrd-galley/.drone.star

74 lines
2 KiB
Text
Raw Normal View History

2021-02-11 19:52:31 +01:00
def main(ctx):
2021-02-12 16:19:02 +01:00
tags = [ctx.build.commit]
2021-02-11 19:52:31 +01:00
if ctx.build.event == "tag":
name = "release"
elif ctx.build.branch == "master":
name = "master"
2021-02-12 16:19:02 +01:00
tags.append("latest")
2021-02-11 19:52:31 +01:00
else:
return
2021-02-16 11:30:34 +01:00
return [
{
"kind": "pipeline",
"name": name,
"steps": [
{
"name": "prepare data",
"image": "alpine",
"commands": [
"apk update && apk add bash curl",
"FORCE_DOWNLOAD=y ./build-tmp-XXX"
]
},
# We can't glob and have to add here manually...
step_for(ctx, "core", tags),
step_for(ctx, "core-cuda10.0", tags),
step_for(ctx, "core-cuda10.1", tags),
step_for(ctx, "dinglehopper", tags),
step_for(ctx, "ocrd_calamari", tags),
step_for(ctx, "ocrd_calamari03", tags),
step_for(ctx, "ocrd_cis", tags),
step_for(ctx, "ocrd_fileformat", tags),
step_for(ctx, "ocrd_olena", tags),
step_for(ctx, "ocrd_segment", tags),
step_for(ctx, "ocrd_tesserocr", tags),
step_for(ctx, "ocrd_wrap", tags),
2021-02-16 11:30:34 +01:00
step_for(ctx, "sbb_binarization", tags),
step_for(ctx, "sbb_textline_detector", tags),
step_for(ctx, "eynollah", tags),
step_for(ctx, "ocrd_anybaseocr", tags),
2021-02-16 11:30:34 +01:00
{
"name": "notify",
"image": "drillster/drone-email",
"settings": {
"host": "172.17.0.1",
"from": "drone@ci.moegen-wir.net",
},
"when": {
"status": [ "success", "failure" ]
}
}
]
}
]
2021-02-11 20:23:10 +01:00
2021-02-12 16:19:02 +01:00
def step_for(ctx, sub_image, tags):
2021-02-11 20:23:10 +01:00
return {
"name": "build %s" % sub_image,
"image": "plugins/docker",
"settings": {
2021-02-12 11:35:54 +01:00
"build_args": [
"DRONE_COMMIT=%s" % ctx.build.commit,
],
2021-02-12 16:19:02 +01:00
"tags": tags,
2021-02-11 20:23:10 +01:00
"username": { "from_secret": "docker_username" },
"password": { "from_secret": "docker_password" },
"repo": "quratorspk/ocrd-galley-%s" % sub_image,
2021-02-11 20:23:10 +01:00
"dockerfile": "Dockerfile-%s" % sub_image,
}
}