Skip to content

Commit

Permalink
server: add script for managing servers in bulk
Browse files Browse the repository at this point in the history
  • Loading branch information
delan committed Jan 16, 2025
1 parent ff6bfad commit c367ce1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ $ ./deploy -s ci1.servo.org ci1
$ ./deploy -s ci2.servo.org ci2
```

To deploy, read monitor config, or write monitor config on one or more servers:

```
$ cd server/nixos
$ ./do <deploy|read|write> [host ...]
$ ./do deploy ci0 ci1 ci2
$ ./do read ci0 ci1
$ ./do write ci1 ci2
```

Setting up the monitor service
------------------------------

Expand Down
4 changes: 4 additions & 0 deletions server/nixos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/result
/ci0/
/ci1/
/ci2/
28 changes: 28 additions & 0 deletions server/nixos/do
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env zsh
set -euo pipefail -o bsdecho
action=$1; shift

case "$action" in
(deploy)
for host; do
./deploy -s "$host".servo.org "$host"
done
;;
(read)
for host; do
mkdir -p -- "$host"
rsync root@"$host".servo.org:/config/monitor/{.env,monitor.toml} "$host"/
done
;;
(write)
for host; do
rsync "$host"/{.env,monitor.toml} root@"$host".servo.org:/config/monitor/
done
for host; do
ssh root@"$host".servo.org systemctl restart monitor
done
for host; do
printf '>>> %s\n' https://"$host".servo.org
done
;;
esac

0 comments on commit c367ce1

Please sign in to comment.