@@ -1,3 +1,3 @@
set GOARCH=amd64
set GOOS=linux
-go build -o build/iot_service ./
+go build -o build/iot_service ./
@@ -52,6 +52,8 @@ func initDB() {
if os.Getenv("DEV_ENV") == "1" {
logCfg = gormLogger.Default
}
+ //logCfg = gormLogger.Default
+
db, err := gorm.Open(mysql.New(mysql.Config{
DSN: dsn,
}), &gorm.Config{Logger: logCfg})
@@ -0,0 +1,9 @@
+#!/bin/bash
+ssh root@110.40.223.170 "/usr/bin/killall iot_service"
+ssh root@110.40.223.170 "/usr/bin/rm -r /opt/lc/iot_svr/iot_service"
+scp -r build/* root@110.40.223.170:/opt/lc/iot_svr/
+# 以下需要 在线上服务器执行
+# /opt/lc/iot_svr/start.sh