Stop deploy.sh running under sudo or from an outdated checkout #28
@@ -67,6 +67,7 @@ agent/deploy.sh --rotate web01 # new token, reinstall
|
||||
agent/deploy.sh --dry-run # show the plan
|
||||
agent/deploy.sh -- --with-needrestart # pass options through to install.sh
|
||||
agent/deploy.sh -- --with-apt-update # refresh package lists before each report
|
||||
agent/deploy.sh --allow-outdated # deploy even if this checkout is behind upstream
|
||||
```
|
||||
|
||||
For each host it copies the agent into a private temp directory and runs
|
||||
@@ -78,6 +79,19 @@ in your terminal. A plain run is an upgrade: config and token stay as they
|
||||
are. You'll get sudo prompts on each host, and on the dashboard when
|
||||
registering, unless you have passwordless sudo.
|
||||
|
||||
Run it as yourself, not with `sudo`: it connects with your own SSH config and
|
||||
keys and runs `sudo` on each host itself. Under `sudo`, ssh would read root's
|
||||
config instead, so a custom `Port` or `IdentityFile` disappears and it tries
|
||||
port 22. It refuses to run that way.
|
||||
|
||||
Before deploying, it fetches your checkout's upstream branch. If the checkout
|
||||
is behind (you pulled on the dashboard host but not here, say), it would ship an
|
||||
older agent than the server expects, and the dashboard would keep saying
|
||||
"agent is older" after a deploy that looked fine. So it asks before going on,
|
||||
or refuses when it isn't run from a terminal; `git pull` first, or pass
|
||||
`--allow-outdated` to deploy it anyway. `--dry-run` only warns. If the fetch
|
||||
fails (offline, say), it warns and deploys.
|
||||
|
||||
Both files are git-ignored. Host names default to each host's `hostname -s`;
|
||||
put `<ssh target> <name>` in `agent/hosts` to override. For a host your
|
||||
workstation can't reach directly (e.g. IPv6-only while you're on IPv4), give it
|
||||
|
||||
Reference in new issue
Block a user