22 lines
595 B
Plaintext
22 lines
595 B
Plaintext
|
load("@this//:from-secret.star", "fromSecret")
|
||
|
|
||
|
def rescale(
|
||
|
service,
|
||
|
scaleTo
|
||
|
):
|
||
|
return {
|
||
|
"name": "rescale {service}".format(service=service),
|
||
|
"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),
|
||
|
]
|
||
|
}
|
||
|
}
|