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