diff --git a/.drone.star b/.drone.star index 2c0a63a..606504c 100644 --- a/.drone.star +++ b/.drone.star @@ -8,6 +8,8 @@ def environment(env): ) def map(fn, l): return [fn(x) for x in l] +def echo(x): + return "echo {secret}=${environment} >> env-stack".format(secret = x, environment = x.replace("-", "_")) def identity(x): return x def printSecrets(env): envv = map(identity, env) @@ -23,15 +25,8 @@ def printSecrets(env): "username": fromSecret("ssh-user"), "password": fromSecret("ssh-password"), "script": [ - "echo $(($(date +%s%N)/1000000))", - "echo SSH_HOST=$SSH_HOST > env-stack", - "sleep 5", - "echo SSH_PORT=$SSH_PORT >> env-stack", - "echo LOCAL_DOCKER_REGISTRY=$LOCAL_DOCKER_REGISTRY >> env-stack", - "echo $(($(date +%s%N)/1000000))", - "echo $(($(date +%s%N)/1000000)) >> env-stack", - - ] + "rm -f env.stack", + ] + map(echo, env) } } def steps(name, dependsOn):