Skip to content

Commit

Permalink
[U] 优化脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
zxysilent committed Dec 31, 2020
1 parent 6ce5726 commit edc8e59
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 32 deletions.
File renamed without changes.
50 changes: 50 additions & 0 deletions build_win.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

# 任何语句的执行结果不是true则应该退出
set -e
apphash=`git log --pretty=format:'%h' -1`
if [ $? -ne 0 ]; then
apphash="zxysilent"
fi
appname="blog"
echo "git log $apphash"
# flags="-X 'main.Var=$apphashn'"
# -w 去掉调试信息
# -s 去掉符号表
flags=""
# -a 强制重新构建
# -n 打印编译时会用到的所有命令,但不真正执行
# -x 打印编译时会用到的所有命令
# -race 开启竞态检测

buildProd(){
go build -tags=prod -ldflags "$flags" -o $appname.exe main.go
}
buildDev(){
go build -ldflags "$flags" -o $appname.exe main.go
}
usage() {
echo "Usage: $0 [-p <prod>] [-d <dev>]" 1>&2;
}
while getopts "pd" o; do
case "${o}" in
p)
echo "build prod"
buildProd
;;
d)
echo "build dev"
buildDev
;;
*)
usage
exit 0
;;
esac
done
if [ "$#" -eq 0 ] ; then
usage
echo "build dev"
buildDev
exit 0
fi
53 changes: 27 additions & 26 deletions conf/conf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,63 @@ mode = "dev"
addr = ":8085"
srv = "http://127.0.0.1:8085"

#token 相关
# token 相关
token_key = "token"
#过期时间 h
# 过期时间 h
token_exp = 8
#单点登录
# 单点登录
token_sso =false
#保持在线
# 保持在线
token_keep = false
#加密私钥
# 加密私钥
token_secret ="secret"

#系统
#图片裁剪
# 系统
# 图片裁剪
image_cut = false
image_width = 800
image_height =600
#分页
# 分页
page_min = 5
page_max = 30

#数据库
#数据库地址
# 数据库
# https://github.com/go-sql-driver/mysql
# 数据库地址
db_host = "127.0.0.1"
#数据库端口
# 数据库端口
db_port = 3306
#数据库账号
# 数据库账号
db_user = "root"
#数据库密码
# 数据库密码
db_passwd = "root"
#数据库名称
# 数据库名称
db_name = "blog"
#数据库参数
db_params = "charset=utf8&parseTime=true"
# 数据库参数
db_params = "charset=utf8&parseTime=true&loc=Local"

#orm
#推荐cpu核心数
# orm
# 推荐cpu核心数
orm_idle = 4
#推荐cpu核心数*2
# 推荐cpu核心数*2
orm_open = 8
#显示sql
# 显示sql
orm_show = true
#同步表结构
# 同步表结构
orm_sync = false
# 是否使用orm缓存
# 是否使用orm缓存
orm_cache_use = false
#orm缓存数量
# orm缓存数量
orm_cache_size = 1000
#orm劫持日志输出
# orm劫持日志输出
orm_hijack_log = true

#作者
# 作者
[author]
name = "zxysilent"
website = "https://github.com/zxysilent"

#微信
# 微信
[wechat]
appid = "appid"
secret = "secret"
6 changes: 0 additions & 6 deletions prod-win.sh

This file was deleted.

0 comments on commit edc8e59

Please sign in to comment.