From 4178bf0622d785dec37c380170abc84bdb7bca29 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Sun, 7 Jul 2024 12:04:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E9=83=A8=E5=88=86=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/cid.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)