diff --git a/drone-starlark/repos/huginn/drone.star b/drone-starlark/repos/huginn/drone.star new file mode 100644 index 0000000..df825ad --- /dev/null +++ b/drone-starlark/repos/huginn/drone.star @@ -0,0 +1,74 @@ +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") +load("@this//huginn:public-secrets.star", "publicSecrets") +load("@this//huginn:secret-secrets.star", "secretSecrets") +load("@this//:rescale.star", "rescale") +load("@this//:pull.star", "pull") +load("@this//:deploy.star", "deploy") +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, + [ + scp(base), + wait(15, "wait"), + printSecrets( + "env-huginn", + publicSecrets, + secretSecrets, + ), + 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, + [], + [], + [], + [], + ) + \ No newline at end of file diff --git a/drone-starlark/repos/huginn/public-secrets.star b/drone-starlark/repos/huginn/public-secrets.star new file mode 100644 index 0000000..721f6b1 --- /dev/null +++ b/drone-starlark/repos/huginn/public-secrets.star @@ -0,0 +1,6 @@ +publicSecrets = [ + "smtp-domain", + "smtp-user-name", + "smtp-server", + "smtp-port", +] \ No newline at end of file diff --git a/drone-starlark/repos/huginn/secret-secrets.star b/drone-starlark/repos/huginn/secret-secrets.star new file mode 100644 index 0000000..2233f55 --- /dev/null +++ b/drone-starlark/repos/huginn/secret-secrets.star @@ -0,0 +1,5 @@ +secretSecrets = [ + "smtp-password", + "invitation-code", + "database-password", +] \ No newline at end of file diff --git a/drone-starlark/repos/huginn/stack-name._star b/drone-starlark/repos/huginn/stack-name._star new file mode 100644 index 0000000..ff2c406 --- /dev/null +++ b/drone-starlark/repos/huginn/stack-name._star @@ -0,0 +1 @@ +stackName='huginn' \ No newline at end of file diff --git a/drone-starlark/repos/huginn/stack-root._star b/drone-starlark/repos/huginn/stack-root._star new file mode 100644 index 0000000..7eb2372 --- /dev/null +++ b/drone-starlark/repos/huginn/stack-root._star @@ -0,0 +1 @@ +stackRoot='/stack/huggin' \ No newline at end of file