diff --git a/dsSzxy/Config/Config.ini b/dsSzxy/Config/Config.ini index 29ba6553..57446e53 100644 --- a/dsSzxy/Config/Config.ini +++ b/dsSzxy/Config/Config.ini @@ -7,4 +7,13 @@ AK = PpUaj_b88y1yC6iBXT5axd607P0RZSCpu0TpclBC SK = FN16FQuUEpOBDM_Bj-Rq-AP7h7umSBK5D7czn-aY [savePath] -path= d:/Test/ \ No newline at end of file +path= d:/Test/ + + +[distribute] #发布功能的配置 +ip = 10.10.14.175 +port = 22 +user = root +pwd = dsideal +remotePath = /usr/local/dsMin/dsSzxy/ +localPath = E:\Work\dsMin\dsSso\build \ No newline at end of file diff --git a/dsSzxy/Tools/Distribute.go b/dsSzxy/Tools/Distribute.go index 7c594245..030081c8 100644 --- a/dsSzxy/Tools/Distribute.go +++ b/dsSzxy/Tools/Distribute.go @@ -12,8 +12,8 @@ func main() { //声明远端SSH管理器 cli := SshUtil.New(ConfigUtil.DistributeIp, ConfigUtil.DistributeUser, ConfigUtil.DistributePwd,int(ConfigUtil.DistributePort)) //杀掉进程 - cli.Run("mkdir /usr/local/dsMin/dsSso -p") - cli.Run("ps -ef |grep dsSso |awk '{print $2}'|xargs kill -9") + cli.Run("mkdir /usr/local/dsMin/dsSzxy -p") + cli.Run("ps -ef |grep dsSzxy |awk '{print $2}'|xargs kill -9") //sftp上传文件及文件夹 sftpClient, err := SftpUtil.Connect(ConfigUtil.DistributeUser, ConfigUtil.DistributePwd, ConfigUtil.DistributeIp,int(ConfigUtil.DistributePort)) @@ -31,12 +31,12 @@ func main() { } SftpUtil.UploadDirectory(sftpClient, ConfigUtil.DistributeLocalPath, ConfigUtil.DistributeRemotePath) //执行SSH命令行,授权 - cli.Run("chmod +x /usr/local/dsMin/dsSso/dsSso") - cli.Run("chmod +x /usr/local/dsMin/dsSso/start.sh") - cli.Run("chmod +x /usr/local/dsMin/dsSso/debug.sh") - cli.Run("chmod +x /usr/local/dsMin/dsSso/stop.sh") + cli.Run("chmod +x /usr/local/dsMin/dsSzxy/dsSzxy") + cli.Run("chmod +x /usr/local/dsMin/dsSzxy/start.sh") + cli.Run("chmod +x /usr/local/dsMin/dsSzxy/debug.sh") + cli.Run("chmod +x /usr/local/dsMin/dsSzxy/stop.sh") cli.Run("cd /usr/local/dsMin/dsSso/ && dos2unix *.sh") //启动 - cli.Run("cd /usr/local/dsMin/dsSso && ./start.sh") - log.Println("恭喜,统一认证服务上传并启动成功!") + cli.Run("cd /usr/local/dsMin/dsSzxy && ./start.sh") + log.Println("恭喜,智慧校园服务上传并启动成功!") } diff --git a/dsSzxy/Utils/ConfigUtil/ConfigUtil.go b/dsSzxy/Utils/ConfigUtil/ConfigUtil.go index 3878d658..f5ae339b 100644 --- a/dsSzxy/Utils/ConfigUtil/ConfigUtil.go +++ b/dsSzxy/Utils/ConfigUtil/ConfigUtil.go @@ -11,6 +11,14 @@ var ( ServerPort string SavePath string + + //要发布到的主机信息 + DistributeIp string + DistributePort int32 + DistributeUser string + DistributePwd string + DistributeRemotePath string + DistributeLocalPath string ) func init() { @@ -26,6 +34,20 @@ func init() { fmt.Printf("try load config file[%s] error[%s]\n", configIniFile, err.Error()) return } + + //发布的远端IP + DistributeIp = iniParser.GetString("distribute", "ip") + //发布的远端端口 + DistributePort = iniParser.GetInt32("distribute", "port") + //发布的远端用户名 + DistributeUser = iniParser.GetString("distribute", "user") + //发布的远端密码 + DistributePwd = iniParser.GetString("distribute", "pwd") + //远端路径 + DistributeRemotePath = iniParser.GetString("distribute", "remotePath") + //本地路径 + DistributeLocalPath = iniParser.GetString("distribute", "localPath") + //服务器端口 ServerPort = iniParser.GetString("server", "port") //保存路径 diff --git a/dsSzxy/WinBuild/Distribute.exe b/dsSzxy/WinBuild/Distribute.exe index e7f98087..16df4336 100644 Binary files a/dsSzxy/WinBuild/Distribute.exe and b/dsSzxy/WinBuild/Distribute.exe differ diff --git a/dsSzxy/build/Config/Config.ini b/dsSzxy/build/Config/Config.ini index bb478b8a..57446e53 100644 --- a/dsSzxy/build/Config/Config.ini +++ b/dsSzxy/build/Config/Config.ini @@ -1,33 +1,19 @@ -[mysql] # mysql1的配置项 -ip = 10.10.14.187 -port = 22066 -database = base_db_dev -user = root -pwd = DsideaL147258369 +[server] #gin服务器的端口 +port = 8010 + +[qiniu] +BUCKET = dsideal_yy +AK = PpUaj_b88y1yC6iBXT5axd607P0RZSCpu0TpclBC +SK = FN16FQuUEpOBDM_Bj-Rq-AP7h7umSBK5D7czn-aY + +[savePath] +path= d:/Test/ + [distribute] #发布功能的配置 -ip = 10.10.14.187 +ip = 10.10.14.175 port = 22 user = root pwd = dsideal -remotePath = /usr/local/dsMin/dsSso/ -localPath = E:\Work\dsMin\dsSso\build - -[redis] -ip = 10.10.14.187 -port = 18890 -db = 0 - -[kafka] -KafkaAddress = 10.10.14.238:9092 -KafkaAccessLogTopic = dsAccessLog -# ---------------------------------------------------------------------------------------------------- - -[server] #gin服务器的端口 -port = 8000 - -# 验证码的有效时间,单位:秒 -CaptchaExpireTime = 120 - -[install_area] -code = changchun \ No newline at end of file +remotePath = /usr/local/dsMin/dsSzxy/ +localPath = E:\Work\dsMin\dsSso\build \ No newline at end of file diff --git a/dsSzxy/build/Config/logo.txt b/dsSzxy/build/Config/logo.txt index 3b83bf3a..700e800e 100644 --- a/dsSzxy/build/Config/logo.txt +++ b/dsSzxy/build/Config/logo.txt @@ -1,7 +1,10 @@ - | | / ____| - __| |___| (___ ___ ___ - / _` / __|\___ \/ __|/ _ \ - | (_| \__ \____) \__ \ (_) | - \__,_|___/_____/|___/\___/ + _ _____ + | | / ____| + __| |___| (___ ______ ___ _ + / _` / __|\___ \_ /\ \/ / | | | + | (_| \__ \____) / / > <| |_| | + \__,_|___/_____/___|/_/\_\\__, | + __/ | + |___/ Created By HuangHai 2020-03-20 -http://patorjk.com/software/taag/#p=display&f=Big&t=dsSso +http://patorjk.com/software/taag/#p=display&f=Big&t=dsSzxy diff --git a/dsSzxy/build/docs/docs.go b/dsSzxy/build/docs/docs.go index 95bc25c0..082d847f 100644 --- a/dsSzxy/build/docs/docs.go +++ b/dsSzxy/build/docs/docs.go @@ -663,7 +663,7 @@ type swaggerInfo struct { // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = swaggerInfo{ Version: "2.0", - Host: "10.10.14.187:8000", + Host: "127.0.0.1:8000", BasePath: "", Schemes: []string{}, Title: "东师理想统一认证中心(OAuth2+Sso)", diff --git a/dsSzxy/build/docs/swagger.json b/dsSzxy/build/docs/swagger.json index 8d86d57a..a06edb04 100644 --- a/dsSzxy/build/docs/swagger.json +++ b/dsSzxy/build/docs/swagger.json @@ -6,7 +6,7 @@ "contact": {}, "version": "2.0" }, - "host": "10.10.14.187:8000", + "host": "127.0.0.1:8000", "paths": { "/oauth2/AddClient": { "post": { diff --git a/dsSzxy/build/docs/swagger.yaml b/dsSzxy/build/docs/swagger.yaml index 81501496..5832322d 100644 --- a/dsSzxy/build/docs/swagger.yaml +++ b/dsSzxy/build/docs/swagger.yaml @@ -32,7 +32,7 @@ definitions: description: 个数 type: object type: object -host: 10.10.14.187:8000 +host: 127.0.0.1:8000 info: contact: {} description: 参考自xxl-sso diff --git a/dsSzxy/build/dsSzxy b/dsSzxy/build/dsSzxy new file mode 100644 index 00000000..81a6e7ce Binary files /dev/null and b/dsSzxy/build/dsSzxy differ diff --git a/dsSzxy/一键发布.cmd b/dsSzxy/一键发布.cmd index c2492ab6..591cad4f 100644 --- a/dsSzxy/一键发布.cmd +++ b/dsSzxy/一键发布.cmd @@ -1,20 +1,20 @@ :: Windows汾 -ldflags "-s -w" go build -o ./WinBuild/Distribute.exe ./Tools/Distribute.go -go build -o ./WinBuild/ReplaceSwaggerIp.exe ./Tools/ReplaceSwaggerIp.go +::go build -o ./WinBuild/ReplaceSwaggerIp.exe ./Tools/ReplaceSwaggerIp.go ::.\Tools\upx.exe -9 ./WinBuild/Distribute.exe :: 滻swagger ipΪԶip -.\WinBuild\ReplaceSwaggerIp.exe -action remote -swag init +::.\WinBuild\ReplaceSwaggerIp.exe -action remote +::swag init :: Linux汾 SET GOOS=linux SET GOARCH=amd64 -go build -gcflags "all=-N -l" -o ./build/dsSso main.go -:: go build -o ./build/dsSso main.go +go build -gcflags "all=-N -l" -o ./build/dsSzxy main.go +:: go build -o ./build/dsSzxy main.go :: ѹһ -::.\Tools\upx.exe -9 ./build/dsSso +::.\Tools\upx.exe -9 ./build/dsSzxy :: Դļ @@ -27,6 +27,6 @@ xcopy .\Xml\* .\build\Xml /y /e /i /q .\WinBuild\Distribute.exe :: 滻swagger ipΪip -.\WinBuild\ReplaceSwaggerIp.exe -action localhost -swag init +::.\WinBuild\ReplaceSwaggerIp.exe -action localhost +::swag init pause \ No newline at end of file