GO打包部署指令碼
開發環境都是在Windows進行開發,經常打包釋出到Linux下部署.
$ Linux 打包 build_linux.bat
@echo offecho=echo set sytem envset GOOS=linuxset GOARCH=amd64echo copy configif not exist %cd%\\bin\\conf\\ md %cd%\\bin\\conf\\xcopy /Y /S %cd%\\conf %cd%\\bin\\conf\\xcopy /Y /S %cd%\\conf\\app_prod.ini %cd%\\bin\\conf\\app.inixcopy /Y /S %cd%\\conf\\app_pord.conf %cd%\\bin\\conf\\app.confecho copy resourceif not exist %cd%\\bin\\assets\\ md %cd%\\bin\\assets\\xcopy /Y /S %cd%\\assets %cd%\\bin\\assets\\echo buildgo build -v -x -o bin/FOOT000 FOOT000.goecho=pause
$ Windows exe 打包 build_windows.bat@echo offecho=echo copy configif not exist %cd%\\bin\\conf\\ md %cd%\\bin\\conf\\xcopy /Y /S %cd%\\conf %cd%\\bin\\conf\\xcopy /Y /S %cd%\\conf\\app_prod.ini %cd%\\bin\\conf\\app.inixcopy /Y /S %cd%\\conf\\app_pord.conf %cd%\\bin\\conf\\app.confecho copy resourceif not exist %cd%\\bin\\assets\\ md %cd%\\bin\\assets\\xcopy /Y /S %cd%\\assets %cd%\\bin\\assets\\echo buildgo build -v -x -o bin/FOOT000.exe FOOT000Cmd.goecho=pause
最新評論