27 lines
765 B
Plaintext
27 lines
765 B
Plaintext
load("@this//:from-secret.star", "fromSecret")
|
|
load("@this//:map.star", "map")
|
|
load("@this//:environment.star", "environment")
|
|
load("@this//:export.star", "export")
|
|
|
|
def pull(
|
|
images,
|
|
):
|
|
secrets = [ "local-docker-registry"]
|
|
return {
|
|
"name": "pull",
|
|
"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 ]
|
|
}
|
|
}
|