mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
[Feature] Development quickstart guide and Makefile additions (#3495)
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
parent
b1325ce03f
commit
a081b62823
3 changed files with 53 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -63,3 +63,4 @@ node_modules
|
|||
/stash
|
||||
dist
|
||||
.DS_Store
|
||||
/.local
|
||||
22
Makefile
22
Makefile
|
|
@ -9,9 +9,14 @@ endif
|
|||
ifdef IS_WIN_SHELL
|
||||
SEPARATOR := &&
|
||||
SET := set
|
||||
RM := del /s /q
|
||||
RMDIR := rmdir /s /q
|
||||
PWD := $(shell echo %cd%)
|
||||
else
|
||||
SEPARATOR := ;
|
||||
SET := export
|
||||
RM := rm -f
|
||||
RMDIR := rm -rf
|
||||
endif
|
||||
|
||||
# set LDFLAGS environment variable to any extra ldflags required
|
||||
|
|
@ -211,6 +216,23 @@ it:
|
|||
generate-test-mocks:
|
||||
go run -mod=vendor github.com/vektra/mockery/v2 --dir ./pkg/models --name '.*ReaderWriter' --outpkg mocks --output ./pkg/models/mocks
|
||||
|
||||
# runs server
|
||||
# sets the config file to use the local dev config
|
||||
.PHONY: server-start
|
||||
server-start: export STASH_CONFIG_FILE=config.yml
|
||||
server-start:
|
||||
ifndef IS_WIN_SHELL
|
||||
@mkdir -p .local
|
||||
else
|
||||
@if not exist ".local" mkdir .local
|
||||
endif
|
||||
cd .local && go run ../cmd/stash
|
||||
|
||||
# removes local dev config files
|
||||
.PHONY: server-clean
|
||||
server-clean:
|
||||
$(RMDIR) .local
|
||||
|
||||
# installs UI dependencies. Run when first cloning repository, or if UI
|
||||
# dependencies have changed
|
||||
.PHONY: pre-ui
|
||||
|
|
|
|||
|
|
@ -39,8 +39,35 @@ NOTE: The `make` command in Windows will be `mingw32-make` with MingW. For examp
|
|||
* `make fmt` - Run `go fmt`
|
||||
* `make it` - Run the unit and integration tests
|
||||
* `make validate` - Run all of the tests and checks required to submit a PR
|
||||
* `make server-start` - Runs an instance of the server in the `.local` directory.
|
||||
* `make server-clean` - Removes the `.local` directory and all of its contents.
|
||||
* `make ui-start` - Runs the UI in development mode. Requires a running stash server to connect to. Stash server port can be changed from the default of `9999` using environment variable `VITE_APP_PLATFORM_PORT`. UI runs on port `3000` or the next available port.
|
||||
|
||||
## Local development quickstart
|
||||
|
||||
1. Run `make pre-ui` to install UI dependencies
|
||||
2. Run `make generate` to create generated files
|
||||
3. In one terminal, run `make server-start` to run the server code
|
||||
4. In a separate terminal, run `make ui-start` to run the UI in development mode
|
||||
5. Open the UI in a browser `http://localhost:3000/`
|
||||
|
||||
Changes to the UI code can be seen by reloading the browser page.
|
||||
|
||||
Changes to the server code requires a restart (`CTRL-C` in the server terminal).
|
||||
|
||||
On first launch:
|
||||
1. On the "Stash Setup Wizard" screen, choose a directory with some files to test with
|
||||
2. Press "Next" to use the default locations for the database and generated content
|
||||
3. Press the "Confirm" and "Finish" buttons to get into the UI
|
||||
4. On the side menu, navigate to "Tasks -> Library -> Scan" and press the "Scan" button
|
||||
5. You're all set! Set any other configurations you'd like and test your code changes.
|
||||
|
||||
To start fresh with new configuration:
|
||||
1. Stop the server (`CTRL-C` in the server terminal)
|
||||
2. Run `make server-clean` to clear all config, database, and generated files (under `.local/`)
|
||||
3. Run `make server-start` to restart the server
|
||||
4. Follow the "On first launch" steps above
|
||||
|
||||
## Building a release
|
||||
|
||||
1. Run `make pre-ui` to install UI dependencies
|
||||
|
|
|
|||
Loading…
Reference in a new issue