mirror of
https://codeberg.org/icewind/haze.git
synced 2026-10-01 08:44:09 +02:00
feat(start): Add --detach flag
This will create a dedicated worktree for the instance. App listed to be enabled will also benefit from their own worktrees. The worktree is cleanup when the instance is destroyed.
This commit is contained in:
parent
c54302fdaa
commit
0e702f7b87
9 changed files with 339 additions and 27 deletions
25
README.md
25
README.md
|
|
@ -56,7 +56,7 @@ See the [configuration section](#configuration) for more options.
|
|||
#### Start an instance
|
||||
|
||||
```bash
|
||||
haze start [--name <name>] [database] [php-version] [services] [vX.Y.Z]
|
||||
haze start [--name <name>] [--detach] [database] [php-version] [services] [vX.Y.Z]
|
||||
```
|
||||
|
||||
Where `database` is one of `sqlite`, `mysql`, `mariadb`, `pgsql` or `oracle`
|
||||
|
|
@ -70,6 +70,10 @@ release instead of using the local sources.
|
|||
Use `--name <name>` to give the instance a specific name instead of a randomly
|
||||
generated one. For example:
|
||||
|
||||
Use `--detach` to give the instance
|
||||
[its own sources](#instances-with-their-own-sources) instead of sharing
|
||||
`sources_root` with all other instances.
|
||||
|
||||
Additionally, you can use the following options when starting an instance:
|
||||
|
||||
- `s3`: set up an S3 server and configure to Nextcloud to use it as primary
|
||||
|
|
@ -134,6 +138,24 @@ haze list
|
|||
haze clean
|
||||
```
|
||||
|
||||
### Instances with their own sources
|
||||
|
||||
By default every instance shares the sources configured as `sources_root`, so
|
||||
all instances always run the same code. An instance started with `--detach` gets
|
||||
its own `git worktree` of `sources_root` instead, created in `worktree_dir`,
|
||||
which lets you run several instances on different branches at the same time.
|
||||
|
||||
```bash
|
||||
haze start --name my-fix --detach
|
||||
```
|
||||
|
||||
The worktree is checked out with a detached head. Every app in one of the
|
||||
`app_directories` that gets enabled during setup receives its own worktree as
|
||||
well, other apps keep running from the shared app directory.
|
||||
|
||||
The worktrees are removed together with the instance, by `haze stop` or
|
||||
`haze clean`.
|
||||
|
||||
## Controlling running instances
|
||||
|
||||
The following commands run against the most recently started instance and allow
|
||||
|
|
@ -358,6 +380,7 @@ options
|
|||
sources_root = "/path/to/sources" # path of the nextcloud sources. required
|
||||
app_directories = ["/path/to/sources/more_app"] # paths to additional app directories.
|
||||
work_dir = "/path/to/temp/dir" # path to temporary directory. optional, defaults to "/tmp/haze"
|
||||
worktree_dir = "/path/to/worktrees" # where to create the worktrees of detached instances. optional, defaults to "<work_dir>/worktrees"
|
||||
|
||||
[auto_setup] # optional
|
||||
enabled = false # whether or not to automatically install nextcloud on `haze start`. enabled by default
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue