git - drone - ghost - guacamole - rocket chat https://sigyl.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

rescale.star 595 B

1 year ago
1 year ago
1 year ago
123456789101112131415161718192021
  1. load("@this//:from-secret.star", "fromSecret")
  2. def rescale(
  3. service,
  4. scaleTo
  5. ):
  6. return {
  7. "name": "rescale {service}".format(service=service),
  8. "image": "appleboy/drone-ssh",
  9. "settings": {
  10. "host": fromSecret("ssh-host"),
  11. "port": fromSecret("ssh-port"),
  12. "username": fromSecret("ssh-root-user"),
  13. "password": fromSecret("ssh-root-password"),
  14. "script": [
  15. "set -e",
  16. "docker service scale {service}=0".format(service=service),
  17. "docker service scale {service}={scaleTo}".format(service=service, scaleTo=scaleTo),
  18. ]
  19. }
  20. }