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

This commit is contained in:
Giles Bradshaw 2020-04-26 09:54:48 +01:00
parent c0f1cb7a44
commit c0f500b362
1 changed files with 34 additions and 12 deletions

View File

@ -10,18 +10,25 @@ def map(fn, l):
return [fn(x) for x in l]
def secretToEnvironment(secret):
return secret.replace("-", "_").upper()
def echo(secret):
return [
"echo {secret}=${environment} >> env-stack".format(
def echo(filename):
def mapped(secret):
return "export {environment}='${environment}' >> {filename} # {secret}".format(
secret = secret,
environment = secret.replace("-", "_").upper(),
filename = filename,
)
return mapped
def echoSecret(secret):
return "export {environment}=??? >> env-stack # {secret}".format(
secret = secret,
environment = secret.replace("-", "_").upper()
)
]
def export(secret):
return "export {toCaps}=${toCaps}".format(
toCaps = secretToEnvironment(secret),
)
def printSecrets(env):
def printSecrets(filename, env, secretEnv):
return {
"name": "print secrets",
@ -35,7 +42,8 @@ def printSecrets(env):
"password": fromSecret("ssh-password"),
"script": [
"rm -f env-stack",
] + map(echo, env)
] + map(echo(filename), env)
+ mapSecret(echoSecret, secretEnv)
}
}
def wait(delay, name):
@ -176,12 +184,26 @@ def steps(name, dependsOn):
"name": name,
"depends_on": dependsOn,
"steps": [
printSecrets([
printSecrets(
"env-stack",
[
"blog-domain"
"certbot-email",
"chat-domain",
"drone-domain",
"drone-gitea-client-id",
"drone-gitea-server",
"git-domain",
"local-docker-registry",
"ssh-host",
"remote-domain",
"ssh-user",
"ssh-port",
]),
],
[
"drone-convert-secret",
"drone-gitea-client-secret",
"drone-rpc-secret",
],
),
wait(15, "wait"),
build("guacamole-postgresql"),
build("ngrok-gitea"),