diff --git a/handler/cid.go b/handler/cid.go index fb74a09..8fbeaad 100644 --- a/handler/cid.go +++ b/handler/cid.go @@ -65,10 +65,10 @@ func RunCID(c *gin.Context) { names := strings.Split(name, ".") name = names[0] - //脚本内容 + //脚本内容,不同用户的持续集成、部署目录不同 scriptContent := ` echo "start" -TARGET_DIR=` + proto.CID_BASE_DIR + username.(string) + `/workspace/` + name + ` //不同用户的持续集成、部署目录不同 +TARGET_DIR=` + proto.CID_BASE_DIR + username.(string) + `/workspace/` + name + ` if [ ! -d $TARGET_DIR ]; then git clone ` + cid.Url + ` cd $TARGET_DIR @@ -77,6 +77,8 @@ else git pull fi ` + cid.Script + ` +pwd +ls -lh echo "end"` //执行脚本 cmd := exec.Command("/bin/bash", "-c", scriptContent) @@ -217,6 +219,8 @@ else git pull fi ` + res.Script + ` +pwd +ls -lh echo "end"` //执行脚本 cmd := exec.Command("/bin/bash", "-c", scriptContent)