first commit
This commit is contained in:
38
build.sh
Executable file
38
build.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# User Expiry API - Linux Build Script
|
||||
# 用户到期API - Linux构建脚本
|
||||
|
||||
echo "开始构建Linux版本..."
|
||||
echo "Building Linux version..."
|
||||
|
||||
# 设置构建参数
|
||||
export GOOS=linux
|
||||
export GOARCH=amd64
|
||||
|
||||
# 构建可执行文件
|
||||
echo "正在编译..."
|
||||
go build -o api main.go
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ 构建成功!"
|
||||
echo "✅ Build successful!"
|
||||
echo ""
|
||||
echo "生成的文件: api"
|
||||
echo "Generated file: api"
|
||||
echo ""
|
||||
echo "部署说明:"
|
||||
echo "Deployment instructions:"
|
||||
echo "1. 上传 api 和 users.json 到Linux服务器"
|
||||
echo " Upload api and users.json to Linux server"
|
||||
echo "2. 添加执行权限: chmod +x api"
|
||||
echo " Add execute permission: chmod +x api"
|
||||
echo "3. 运行: ./api"
|
||||
echo " Run: ./api"
|
||||
echo ""
|
||||
ls -la api
|
||||
else
|
||||
echo "❌ 构建失败!"
|
||||
echo "❌ Build failed!"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user