ocrd-galley/.drone.star

57 lines
1.5 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
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...
2021-02-12 16:19:02 +01:00
step_for(ctx, "core", tags),
step_for(ctx, "core-cuda10.0", tags),
step_for(ctx, "core-cuda10.1", tags),
2021-02-12 16:19:02 +01:00
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, "sbb_binarization", tags),
step_for(ctx, "sbb_textline_detector", tags),
2021-02-11 19:52:31 +01:00
]
}
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": "mikegerber/my_ocrd_workflow-%s" % sub_image,
"dockerfile": "Dockerfile-%s" % sub_image,
}
}