Adds modd based targets that watch both server and webapp (#1257)
* Adds modd based targets that watch both server and webapp * Add modd precheck to related targets
This commit is contained in:
parent
ca07c9b9c3
commit
9086246fb5
3 changed files with 26 additions and 10 deletions
26
Makefile
26
Makefile
|
@ -1,4 +1,4 @@
|
|||
.PHONY: prebuild clean cleanall ci server server-mac server-linux server-win server-linux-package generate watch-server webapp mac-app win-app-wpf linux-app
|
||||
.PHONY: prebuild clean cleanall ci server server-mac server-linux server-win server-linux-package generate watch-server webapp mac-app win-app-wpf linux-app modd-precheck
|
||||
|
||||
PACKAGE_FOLDER = focalboard
|
||||
|
||||
|
@ -87,21 +87,27 @@ server-lint: ## Run linters on server code.
|
|||
cd server; golangci-lint run ./...
|
||||
cd mattermost-plugin; golangci-lint run ./...
|
||||
|
||||
modd-precheck:
|
||||
@if ! [ -x "$$(command -v modd)" ]; then \
|
||||
echo "modd is not installed. Please see https://github.com/cortesi/modd#install for installation instructions"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
|
||||
watch: modd-precheck ## Run both server and webapp watching for changes
|
||||
modd
|
||||
|
||||
watch-single-user: modd-precheck ## Run both server and webapp in single user mode watching for changes
|
||||
env FOCALBOARDSERVER_ARGS=--single-user modd
|
||||
|
||||
watch-server-test: modd-precheck ## Run server tests watching for changes
|
||||
modd -f modd-servertest.conf
|
||||
|
||||
server-test: ## Run server tests
|
||||
cd server; go test -race -v -count=1 ./...
|
||||
|
||||
watch-server: ## Run server watching for changes with modd (https://github.com/cortesi/modd).
|
||||
cd server; modd
|
||||
|
||||
watch-server-single-user: ## Run server watching for changes with modd (https://github.com/cortesi/modd) using single user config.
|
||||
cd server; env FOCALBOARDSERVER_ARGS=--single-user modd
|
||||
|
||||
webapp: ## Build webapp.
|
||||
cd webapp; npm run pack
|
||||
|
||||
watch-webapp: ## Run webapp watching for changes.
|
||||
cd webapp; npm run watchdev
|
||||
|
||||
mac-app: server-mac webapp ## Build Mac application.
|
||||
rm -rf mac/temp
|
||||
rm -rf mac/dist
|
||||
|
|
4
modd-servertest.conf
Normal file
4
modd-servertest.conf
Normal file
|
@ -0,0 +1,4 @@
|
|||
**/*.go {
|
||||
indir: server
|
||||
prep: go test -race -v ./...
|
||||
}
|
|
@ -1,4 +1,10 @@
|
|||
**/*.go !**/*_test.go {
|
||||
indir: server
|
||||
prep: go build -o ../bin/focalboard-server ./main
|
||||
daemon +sigterm: cd .. && ./bin/focalboard-server $FOCALBOARDSERVER_ARGS
|
||||
}
|
||||
|
||||
{
|
||||
indir: webapp
|
||||
daemon: npm run watchdev
|
||||
}
|
Loading…
Reference in a new issue