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