ci(drone): 添加 Go 模块和构建缓存
- 在 restore cache 和 rebuild cache 步骤中添加了 go-mod-cache 和 go
This commit is contained in:
@@ -1,49 +0,0 @@
|
|||||||
@echo off
|
|
||||||
chcp 65001 >nul
|
|
||||||
|
|
||||||
echo ==========================================
|
|
||||||
echo Epic Game Web Service
|
|
||||||
echo Starting with cron jobs enabled...
|
|
||||||
echo ==========================================
|
|
||||||
|
|
||||||
REM 检查Go环境
|
|
||||||
go version >nul 2>&1
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Error: Go is not installed or not in PATH
|
|
||||||
pause
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
REM 检查Go版本
|
|
||||||
for /f "tokens=3" %%i in ('go version') do set GO_VERSION=%%i
|
|
||||||
echo Go version: %GO_VERSION%
|
|
||||||
|
|
||||||
REM 设置环境变量
|
|
||||||
set GO_ENV=production
|
|
||||||
set GF_GCFG_FILE=manifest/config/config.yaml
|
|
||||||
|
|
||||||
REM 清理旧的构建文件
|
|
||||||
echo Cleaning old build files...
|
|
||||||
if exist main.exe del main.exe
|
|
||||||
if exist main del main
|
|
||||||
|
|
||||||
REM 构建项目
|
|
||||||
echo Building project...
|
|
||||||
go build -o main.exe .
|
|
||||||
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Error: Build failed
|
|
||||||
pause
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
echo Build successful!
|
|
||||||
|
|
||||||
REM 启动服务
|
|
||||||
echo Starting server on port 8283...
|
|
||||||
echo Cron jobs will be started automatically...
|
|
||||||
echo Press Ctrl+C to stop the server
|
|
||||||
echo ==========================================
|
|
||||||
|
|
||||||
REM 运行服务
|
|
||||||
main.exe
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Epic Game Web Service 启动脚本
|
|
||||||
|
|
||||||
echo "=========================================="
|
|
||||||
echo "Epic Game Web Service"
|
|
||||||
echo "Starting with cron jobs enabled..."
|
|
||||||
echo "=========================================="
|
|
||||||
|
|
||||||
# 检查Go环境
|
|
||||||
if ! command -v go &> /dev/null; then
|
|
||||||
echo "Error: Go is not installed or not in PATH"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 检查Go版本
|
|
||||||
GO_VERSION=$(go version | awk '{print $3}' | sed 's/go//')
|
|
||||||
echo "Go version: $GO_VERSION"
|
|
||||||
|
|
||||||
# 设置环境变量
|
|
||||||
export GO_ENV=production
|
|
||||||
export GF_GCFG_FILE=manifest/config/config.yaml
|
|
||||||
|
|
||||||
# 清理旧的构建文件
|
|
||||||
echo "Cleaning old build files..."
|
|
||||||
rm -f main.exe
|
|
||||||
rm -f main
|
|
||||||
|
|
||||||
# 构建项目
|
|
||||||
echo "Building project..."
|
|
||||||
go build -o main.exe .
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Error: Build failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Build successful!"
|
|
||||||
|
|
||||||
# 启动服务
|
|
||||||
echo "Starting server on port 8283..."
|
|
||||||
echo "Cron jobs will be started automatically..."
|
|
||||||
echo "Press Ctrl+C to stop the server"
|
|
||||||
echo "=========================================="
|
|
||||||
|
|
||||||
# 运行服务
|
|
||||||
./main.exe
|
|
||||||
Reference in New Issue
Block a user