Skip to content

Commit a3359f7

Browse files
author
bajins
committed
update config.json避免被覆盖,现更名为config.example.json
1 parent 8e4dff6 commit a3359f7

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
> URL:http://127.0.0.1:8000/webHooks
99
10+
> 复制`data`目录中的`config.example.json`文件重命名为`config.json`并修改里面的值
11+
1012
```json
1113
{
1214
"这里是仓库full_name的值": {

server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"fmt"
77
"io/ioutil"
8+
"log"
89
"net/http"
910
"os"
1011
"reflect"
@@ -85,8 +86,10 @@ func webHooks(w http.ResponseWriter, r *http.Request) {
8586
return
8687
}
8788
id := contentMap["repository"].(map[string]interface{})["full_name"].(string)
89+
log.Println("当前full_name:", id)
8890
//id = strings.ToLower(id)
8991
config := config[id]
92+
log.Println("当前配置:", config)
9093
if reflect.DeepEqual(config, Config{}) {
9194
fmt.Fprintln(w, "{\"code\":200, \"error\":\"Config is not found\"}")
9295
return

task.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ func startTask(task *TaskQueue) {
4848
} else {
4949
log.Fatal(filePath, "执行错误:", err)
5050
utils.Log2file(fmt.Sprintf("部署失败:%s %s", filePath, err), GetLogName(task.Id))
51+
// 如果执行失败则添加到队列末尾,等待稍后继续执行
52+
//queue = append(queue, task)
5153
}
5254
}
5355
queue = queue[:0]

0 commit comments

Comments
 (0)