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/pull.star

28 lines
771 B
Plaintext
Raw Permalink Normal View History

2020-04-26 17:06:31 +00:00
load("@this//:from-secret.star", "fromSecret")
load("@this//:map.star", "map")
load("@this//:environment.star", "environment")
load("@this//:export.star", "export")
def pull(
2020-04-30 20:04:50 +00:00
name,
2020-04-26 17:06:31 +00:00
images,
):
secrets = [ "local-docker-registry"]
return {
2020-04-30 20:04:50 +00:00
"name": name,
2020-04-26 17:06:31 +00:00
"image": "appleboy/drone-ssh",
"environment": environment(secrets),
"settings": {
"envs": [x.replace("-", "_") for x in secrets ],
"host": fromSecret("ssh-host"),
"port": fromSecret("ssh-port"),
"username": fromSecret("ssh-root-user"),
"password": fromSecret("ssh-root-password"),
"script": [
"set -e"
] +
map(export, secrets) +
["docker pull $${{LOCAL_DOCKER_REGISTRY}}{image}".format(image=image) for image in images ]
}
}