2020-04-26 11:56:39 +00:00
|
|
|
load("@this//:map.star", "map")
|
2020-04-26 12:15:31 +00:00
|
|
|
load("@this//:from-secret.star", "fromSecret")
|
2020-04-26 12:44:27 +00:00
|
|
|
load("@this//:environment.star", "environment")
|
2020-04-26 13:34:46 +00:00
|
|
|
load("@this//:echo.star", "echo")
|
|
|
|
load("@this//:export.star", "export")
|
|
|
|
load("@this//:echo-secret.star", "echoSecret")
|
2020-04-26 11:56:39 +00:00
|
|
|
|
2020-04-26 11:53:32 +00:00
|
|
|
def printSecrets(filename, env, secretEnv):
|
|
|
|
return {
|
|
|
|
"name": "print secrets",
|
|
|
|
"image": "appleboy/drone-ssh",
|
2020-04-30 18:01:09 +00:00
|
|
|
"environment": environment(env + secretEnv),
|
2020-04-26 11:53:32 +00:00
|
|
|
"settings": {
|
2020-04-30 18:01:09 +00:00
|
|
|
"envs": [x.replace("-", "_") for x in env + secretEnv ],
|
2020-04-26 11:53:32 +00:00
|
|
|
"host": fromSecret("ssh-host"),
|
|
|
|
"port": fromSecret("ssh-port"),
|
|
|
|
"username": fromSecret("ssh-user"),
|
|
|
|
"password": fromSecret("ssh-password"),
|
|
|
|
"script": [x.replace("***filename***", filename) for x in [
|
|
|
|
"rm -f env-stack",
|
|
|
|
] + map(echo, env)
|
2020-05-03 22:03:23 +00:00
|
|
|
+ map(echo, secretEnv)]
|
2020-04-26 11:53:32 +00:00
|
|
|
}
|
|
|
|
}
|