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

22 lines
595 B
Plaintext
Raw Normal View History

2020-04-30 00:23:15 +00:00
load("@this//:from-secret.star", "fromSecret")
def rescale(
service,
scaleTo
):
return {
2020-04-30 00:38:25 +00:00
"name": "rescale {service}".format(service=service),
2020-04-30 00:23:15 +00:00
"image": "appleboy/drone-ssh",
"settings": {
"host": fromSecret("ssh-host"),
"port": fromSecret("ssh-port"),
"username": fromSecret("ssh-root-user"),
"password": fromSecret("ssh-root-password"),
"script": [
"set -e",
"docker service scale {service}=0".format(service=service),
"docker service scale {service}={scaleTo}".format(service=service, scaleTo=scaleTo),
]
}
}