filebrowser/makefile

48 lines
1.4 KiB
Makefile
Raw Normal View History

2024-07-30 17:45:27 +00:00
setup:
2024-11-21 00:15:30 +00:00
go install github.com/swaggo/swag/cmd/swag@latest && \
2024-08-24 22:02:33 +00:00
cd frontend && npm i && npx playwright install
2024-08-03 15:34:12 +00:00
if [ ! -f backend/test__config.yaml ]; then \
cp backend/filebrowser.yaml backend/test_config.yaml; \
fi
2024-07-30 17:45:27 +00:00
2024-11-21 00:15:30 +00:00
update:
2024-12-02 17:14:50 +00:00
cd backend && go get -u ./... && go mod tidy && cd ../frontend && npm update
2024-11-21 00:15:30 +00:00
2024-07-30 17:45:27 +00:00
build:
2024-08-24 22:02:33 +00:00
docker build --build-arg="VERSION=testing" --build-arg="REVISION=n/a" -t gtstef/filebrowser .
2024-07-30 17:45:27 +00:00
2024-11-21 00:15:30 +00:00
run: run-frontend
cd backend && swag init --output swagger/docs && \
if [ "$(shell uname)" = "Darwin" ]; then \
sed -i '' '/func init/,+3d' ./swagger/docs/docs.go; \
else \
sed -i '/func init/,+3d' ./swagger/docs/docs.go; \
fi && \
FILEBROWSER_NO_EMBEDED=true go run \
--ldflags="-w -s -X 'github.com/gtsteffaniak/filebrowser/version.CommitSHA=testingCommit' -X 'github.com/gtsteffaniak/filebrowser/version.Version=testing'" . -c test_config.yaml
run-frontend:
cd backend/http && rm -rf dist && ln -s ../../frontend/dist && \
cd ../../frontend && npm run build
2024-07-30 17:45:27 +00:00
2024-08-24 22:02:33 +00:00
lint-frontend:
2024-07-30 17:45:27 +00:00
cd frontend && npm run lint
2024-08-24 22:02:33 +00:00
lint-backend:
cd backend && golangci-lint run --path-prefix=backend
2024-11-21 00:15:30 +00:00
lint: lint-backend lint-frontend
test: test-backend test-frontend
2024-11-26 17:21:41 +00:00
check-all: lint test
2024-08-24 22:02:33 +00:00
test-backend:
2024-11-21 00:15:30 +00:00
cd backend && go test -race -timeout=10s ./...
2024-08-24 22:02:33 +00:00
test-frontend:
2024-11-26 17:21:41 +00:00
cd frontend && npm run test
test-frontend-playwright:
2024-08-24 22:02:33 +00:00
docker build -t gtstef/filebrowser-tests -f Dockerfile.playwright .