drone/drone-starlark/repos/gitea/drone.star

81 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

2020-05-10 19:23:01 +00:00
load("@this//:from-secret.star", "fromSecret")
load("@this//:print-secrets.star", "printSecrets")
load("@this//:map.star", "map")
load("@this//:environment.star", "environment")
load("@this//:echo.star", "echo")
load("@this//:export.star", "export")
load("@this//:echo-secret.star", "echoSecret")
load("@this//:wait.star", "wait")
load("@this//:build.star", "build")
load("@this//:scp.star", "scp")
2020-05-11 10:35:27 +00:00
load("@this//gitea:public-secrets.star", "publicSecrets")
load("@this//gitea:secret-secrets.star", "secretSecrets")
2020-05-10 19:23:01 +00:00
load("@this//:rescale.star", "rescale")
load("@this//:pull.star", "pull")
2020-05-11 18:05:34 +00:00
load("@this//:deploy-from-registry.star", "deploy")
2020-05-10 19:23:01 +00:00
load("@this//:build-folder.star", "buildFolder")
load("@this//:build-docker-folder.star", "buildDockerFolder")
load("@this//:pipeline.star", "pipeline")
def drone(
ctx,
branch,
base,
name,
commands,
):
if ctx.build.branch == branch:
return [
pipeline(
branch,
[
2020-05-11 17:22:22 +00:00
scp(base),
2020-05-10 19:23:01 +00:00
wait(15, "wait"),
printSecrets(
"env-gitea",
publicSecrets,
secretSecrets,
),
build("gitea"),
pull(
"pull images",
[
"gitea",
],
),
deploy(
"docker-compose.yml",
name,
base,
publicSecrets + secretSecrets,
commands,
ctx
),
],
[],
[
{
"name": "ca",
"host": {
"path": "/etc/docker/certs.d",
},
}
],
[
{
"name": "ca",
"path": "/etc/docker/certs.d",
},
]
),
]
else:
return pipeline(
ctx.build.branch,
[],
[],
[],
[],
)