.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Giles Bradshaw 2020-04-26 17:11:26 +01:00
parent 180415b0a5
commit e8e4491647
1 changed files with 6 additions and 34 deletions

View File

@ -9,6 +9,8 @@ load("@this//:echo-secret.star", "echoSecret")
load("@this//:wait.star", "wait") load("@this//:wait.star", "wait")
load("@this//:build.star", "build") load("@this//:build.star", "build")
load("@this//:scp.star", "scp") load("@this//:scp.star", "scp")
load("@this//:public-secrets.star", "publicSecrets")
load("@this//:secret-secrets.star", "secretSecrets")
def buildHome(): def buildHome():
return { return {
@ -52,25 +54,10 @@ def deploy(
filename, filename,
folder, folder,
): ):
secrets = [
"drone-rpc-secret",
"drone-gitea-client-id",
"drone-gitea-client-secret",
"drone-gitea-server",
"drone-convert-secret",
"ssh-user",
"local-docker-registry",
"certbot-email",
"git-domain",
"drone-domain",
"chat-domain",
"remote-domain",
"blog-domain",
]
return { return {
"name": "deploy", "name": "deploy",
"image": "appleboy/drone-ssh", "image": "appleboy/drone-ssh",
"environment": environment(secrets), "environment": environment(publicSecrets + secretSecrets),
"settings": { "settings": {
"envs": [x.replace("-", "_") for x in secrets ], "envs": [x.replace("-", "_") for x in secrets ],
"host": fromSecret("ssh-host"), "host": fromSecret("ssh-host"),
@ -79,7 +66,7 @@ def deploy(
"password": fromSecret("ssh-root-password"), "password": fromSecret("ssh-root-password"),
"script": [ "script": [
"set -e" "set -e"
] + map(export, secrets) + [ ] + map(export, publicSecrets + secretSecrets) + [
"echo {folder}".format(folder=folder), "echo {folder}".format(folder=folder),
"cd {folder}".format(folder=folder), "cd {folder}".format(folder=folder),
"docker pull $${LOCAL_DOCKER_REGISTRY}letsencrypt-git", "docker pull $${LOCAL_DOCKER_REGISTRY}letsencrypt-git",
@ -105,23 +92,8 @@ def pipeline(name, steps, dependsOn):
"steps": [ "steps": [
printSecrets( printSecrets(
"env-stack", "env-stack",
[ publicSecrets,
"blog-domain", secretSecrets,
"certbot-email",
"chat-domain",
"drone-domain",
"drone-gitea-client-id",
"drone-gitea-server",
"git-domain",
"local-docker-registry",
"remote-domain",
"ssh-user",
],
[
"drone-convert-secret",
"drone-gitea-client-secret",
"drone-rpc-secret",
],
), ),
wait(15, "wait"), wait(15, "wait"),
] + steps, ] + steps,