脚本执行内容修复
This commit is contained in:
parent
6acfb4277e
commit
87af0963fc
|
|
@ -71,10 +71,20 @@ 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
|
if [ ! -d $TARGET_DIR ]; then
|
||||||
git clone ` + cid.Url + `
|
git clone ` + cid.Url + `
|
||||||
cd $TARGET_DIR
|
if [ $? -ne 0 ]; then
|
||||||
else
|
echo "Failed to clone repository."
|
||||||
cd $TARGET_DIR
|
exit 1
|
||||||
git pull
|
fi
|
||||||
|
fi
|
||||||
|
cd "$TARGET_DIR"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed to change directory to $TARGET_DIR."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
git pull
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed to pull repository."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
` + cid.Script + `
|
` + cid.Script + `
|
||||||
echo "end"`
|
echo "end"`
|
||||||
|
|
@ -208,13 +218,23 @@ func CIDCallback(c *gin.Context) {
|
||||||
user := dao.FindUserByUserID(res.Auth_id)
|
user := dao.FindUserByUserID(res.Auth_id)
|
||||||
scriptContent := `
|
scriptContent := `
|
||||||
echo "start"
|
echo "start"
|
||||||
TARGET_DIR=` + proto.CID_BASE_DIR + user.Name + `workspace/` + name + `
|
TARGET_DIR=` + proto.CID_BASE_DIR + user.Name + `/workspace/` + name + `
|
||||||
if [ ! -d $TARGET_DIR ]; then
|
if [ ! -d $TARGET_DIR ]; then
|
||||||
git clone ` + res.Url + `
|
git clone ` + res.Url + `
|
||||||
cd $TARGET_DIR
|
if [ $? -ne 0 ]; then
|
||||||
else
|
echo "Failed to clone repository."
|
||||||
cd $TARGET_DIR
|
exit 1
|
||||||
git pull
|
fi
|
||||||
|
fi
|
||||||
|
cd "$TARGET_DIR"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed to change directory to $TARGET_DIR."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
git pull
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed to pull repository."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
` + res.Script + `
|
` + res.Script + `
|
||||||
echo "end"`
|
echo "end"`
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,7 @@ func SRMessage(c *gin.Context) {
|
||||||
}
|
}
|
||||||
defer ws.Close()
|
defer ws.Close()
|
||||||
res := worker.GetRedis(redis_key + "_connection")
|
res := worker.GetRedis(redis_key + "_connection")
|
||||||
|
worker.SetRedisWithExpire("user_"+id.(string)+"_status", "1", time.Second*5)
|
||||||
if res == "" {
|
if res == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue