2024-03-01 19:10:56 +08:00
build : build_fe build_server telegram_push web_push wechat_push package
2024-02-18 14:30:38 +08:00
clean :
rm -rf output
2024-03-01 19:10:56 +08:00
2024-02-18 14:30:38 +08:00
build_fe :
cd fe && yarn && yarn build
2025-01-04 16:23:07 +08:00
rm -rf server/listen/http_server/dist
cd server && cp -rf ../fe/dist listen/http_server
2024-02-18 14:30:38 +08:00
build_server :
cd server && CGO_ENABLED = 0 GOOS = linux GOARCH = amd64 go build -ldflags " -s -w -X 'main.goVersion= $( go version) ' -X 'main.gitHash= $( git show -s --format= %H) ' -X 'main.buildTime= $( TZ = UTC-8 date +%Y-%m-%d" " %H:%M:%S) ' " -o pmail_linux_amd64 main.go
cd server && CGO_ENABLED = 0 GOOS = windows GOARCH = amd64 go build -ldflags " -s -w -X 'main.goVersion= $( go version) ' -X 'main.gitHash= $( git show -s --format= %H) ' -X 'main.buildTime= $( TZ = UTC-8 date +%Y-%m-%d" " %H:%M:%S) ' " -o pmail_windows_amd64.exe main.go
cd server && CGO_ENABLED = 0 GOOS = darwin GOARCH = amd64 go build -ldflags " -s -w -X 'main.goVersion= $( go version) ' -X 'main.gitHash= $( git show -s --format= %H) ' -X 'main.buildTime= $( TZ = UTC-8 date +%Y-%m-%d" " %H:%M:%S) ' " -o pmail_mac_amd64 main.go
cd server && CGO_ENABLED = 0 GOOS = darwin GOARCH = arm64 go build -ldflags " -s -w -X 'main.goVersion= $( go version) ' -X 'main.gitHash= $( git show -s --format= %H) ' -X 'main.buildTime= $( TZ = UTC-8 date +%Y-%m-%d" " %H:%M:%S) ' " -o pmail_mac_arm64 main.go
2024-03-01 19:10:56 +08:00
telegram_push :
cd server/hooks/telegram_push && CGO_ENABLED = 0 GOOS = linux GOARCH = amd64 go build -ldflags "-s -w" -o output/telegram_push_linux_amd64 telegram_push.go
cd server/hooks/telegram_push && CGO_ENABLED = 0 GOOS = windows GOARCH = amd64 go build -ldflags "-s -w" -o output/telegram_push_windows_amd64.exe telegram_push.go
cd server/hooks/telegram_push && CGO_ENABLED = 0 GOOS = darwin GOARCH = amd64 go build -ldflags "-s -w" -o output/telegram_push_mac_amd64 telegram_push.go
cd server/hooks/telegram_push && CGO_ENABLED = 0 GOOS = darwin GOARCH = arm64 go build -ldflags "-s -w" -o output/telegram_push_mac_arm64 telegram_push.go
wechat_push :
cd server/hooks/wechat_push && CGO_ENABLED = 0 GOOS = linux GOARCH = amd64 go build -ldflags "-s -w" -o output/wechat_push_linux_amd64 wechat_push.go
cd server/hooks/wechat_push && CGO_ENABLED = 0 GOOS = windows GOARCH = amd64 go build -ldflags "-s -w" -o output/wechat_push_windows_amd64.exe wechat_push.go
cd server/hooks/wechat_push && CGO_ENABLED = 0 GOOS = darwin GOARCH = amd64 go build -ldflags "-s -w" -o output/wechat_push_mac_amd64 wechat_push.go
cd server/hooks/wechat_push && CGO_ENABLED = 0 GOOS = darwin GOARCH = arm64 go build -ldflags "-s -w" -o output/wechat_push_mac_arm64 wechat_push.go
2024-07-20 10:39:17 +08:00
spam_block :
cd server/hooks/spam_block && CGO_ENABLED = 0 GOOS = linux GOARCH = amd64 go build -ldflags "-s -w" -o output/spam_block_linux_amd64 spam_block.go
cd server/hooks/spam_block && CGO_ENABLED = 0 GOOS = windows GOARCH = amd64 go build -ldflags "-s -w" -o output/spam_block_windows_amd64.exe spam_block.go
cd server/hooks/spam_block && CGO_ENABLED = 0 GOOS = darwin GOARCH = amd64 go build -ldflags "-s -w" -o output/spam_block_mac_amd64 spam_block.go
cd server/hooks/spam_block && CGO_ENABLED = 0 GOOS = darwin GOARCH = arm64 go build -ldflags "-s -w" -o output/spam_block_mac_arm64 spam_block.go
2024-07-27 20:47:42 +08:00
plugin : telegram_push wechat_push
2024-03-01 19:10:56 +08:00
2024-02-18 14:30:38 +08:00
package : clean
mkdir output
mv server/pmail* output/
2024-03-01 19:10:56 +08:00
mkdir output/config
mkdir output/plugins
2024-02-18 14:30:38 +08:00
cp -r server/config/dkim output/config/
cp -r server/config/ssl output/config/
cp -r server/config/config.json output/config/
2024-03-01 19:10:56 +08:00
mv server/hooks/telegram_push/output/* output/plugins
mv server/hooks/wechat_push/output/* output/plugins
2024-02-18 14:30:38 +08:00
cp README.md output/
2024-04-30 14:43:37 +08:00
test :
2025-01-04 16:23:07 +08:00
export setup_port = 17888 && cd server && export PMail_ROOT = $( CURDIR) /server/ && go test -v -p 1 ./...
2024-07-02 21:02:00 +08:00
test_mysql :
2025-01-04 16:23:07 +08:00
export setup_port = 17888 && cd server && export PMail_ROOT = $( CURDIR) /server/ && go test -args "mysql" -v -p 1 ./...
2024-07-14 09:42:43 +08:00
test_postgres :
2025-01-04 16:23:07 +08:00
export setup_port = 17888 && cd server && export PMail_ROOT = $( CURDIR) /server/ && go test -args "postgres" -v -p 1 ./...