mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 16:39:01 +00:00
For #27889 This PR introduces several improvements to the Makefile/`fdm` tool for development: ### `fdm serve` (alias `fdm up`) Starts a local Fleet server (building the binary first). The first time this is called, it will start the server on `localhost:8080` with the `--dev` and `--dev_license` flags, but the command accepts all of the options that you can pass to `fleet serve`. If you pass options to `fdm serve`, then subsequent invocations _without_ options will replay your last command. Additionally, `fdm serve` supports the following: - `--use-ip`: start the local server on your system's local IP address rather than `localhost`. This makes it easier to point VMs on your system to the fleet server to act as hosts. - `--no-build`: don't rebuild the fleet binary before starting the server. - `--no-save`: don't save the current command for future invocations (useful for scripting) - `--show`: show options for the last-invoked `fdm serve` command - `--reset`: reset the options for `fdm serve`. The next time `fdm serve` is invoked, it will use the default options. - `--help`: show all of the Fleet server options ### `fdm snapshot` improvements * Added `fdm snap` alias * Tracks the name of the last snapshot saved, to use as the default for `fdm restore` * Suppresses the "don't use password in CLI" warning when saving the snapshot ### `fdm restore` improvements * Added `--prep` / `--prepare` option to run db migrations after restoring snapshot. * Improved UI (more options displayed, and clearer indicator for selected option) * Now defaults to last snapshot restored
4 lines
232 B
Bash
Executable file
4 lines
232 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
BACKUP_NAME="${1:-backup.sql.gz}"
|
|
docker run --rm -i --network fleet_default ${FLEET_MYSQL_IMAGE:-mysql:8.0.36} bash -c 'gzip -dc - | MYSQL_PWD=toor mysql -hmysql -uroot fleet' < ${BACKUP_NAME}
|