This repository has been archived on 2020-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
stack/drone-starlark/repos/print-secrets.star

25 lines
822 B
Plaintext
Raw Permalink Normal View History

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
}
}