forked from neel1996/gitconvex-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (66 loc) · 2.3 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
get:
go get
run:
go run server.go
build-ui:
@./build_scripts/build_ui.sh
build-server:
@./build_scripts/build_server.sh
clean:
@echo "💨 Cleaning up previous build and bundles..."
@rm -rf ui/ dist/ gitconvex build/
bundle:
@mkdir -p ./dist && \
mv ./build/ ./dist/ && \
mv ./dist/build ./dist/gitconvex-ui;
pack:
cd ./dist && \
tar -cvzf gitconvex-$$GITCONVEX_VERSION.tar.gz .
build: clean build-ui bundle build-server
@echo "✅ Gitconvex Build Completed successfully!"
@echo "📬 Use ./dist/gitconvex to start Gitconvex on port 9001"
@echo "📬 Try ./dist/gitconvex --port PORT_NUMBER to run gitconvex on the desired port"
git-testuser-setup:
git config --global user.name "test"
git config --global user.email "[email protected]"
test:
export GITCONVEX_TEST_REPO="$(PWD)/gitconvex-test" && \
export GITCONVEX_DEFAULT_PATH="$(PWD)/gitconvex-test" && \
rm -rf $$GITCONVEX_TEST_REPO && \
go clean --cache && \
./build_scripts/remove_test_repo.sh && \
./build_scripts/clone_test_repo.sh && \
go test ./... -count=1 -cover -coverprofile=coverage.out && \
rm -rf $$GITCONVEX_TEST_REPO
test-pretty:
export GITCONVEX_TEST_REPO="$(PWD)/gitconvex-test" && \
export GITCONVEX_DEFAULT_PATH="$(PWD)/gitconvex-test" && \
rm -rf $$GITCONVEX_TEST_REPO && \
go clean --cache && \
./build_scripts/remove_test_repo.sh && \
./build_scripts/clone_test_repo.sh && \
gotestsum ./... -count=1 -p=1 -cover -coverprofile=coverage.out && \
rm -rf $$GITCONVEX_TEST_REPO
test-ci: git-testuser-setup
go generate && \
go clean --cache && \
sh ./build_scripts/clone_test_repo.sh && \
go test ./... -count=1 -p=1 -cover -coverprofile=coverage.out && \
rm -rf $$GITCONVEX_TEST_REPO
test-ci-pretty: git-testuser-setup
go generate && \
go clean --cache && \
sh ./build_scripts/clone_test_repo.sh && \
go get gotest.tools/gotestsum && \
gotestsum ./... -count=1 -p=1 -cover -coverprofile=coverage.out && \
rm -rf $$GITCONVEX_TEST_REPO
dockerise-test:
rm -rf $$GITCONVEX_TEST_REPO && \
docker-compose -f docker-compose.test.yaml build && \
docker-compose -f docker-compose.test.yaml up
check-coverage:
bash ./build_scripts/check_coverage.sh
show-coverage:
go tool cover -html=coverage.out
start:
./dist/gitconvex