add path .git

master
zhangshunping 5 years ago
parent 770c961cef
commit 335aff4cd4

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/p2mocv3pr.iml" filepath="$PROJECT_DIR$/.idea/p2mocv3pr.iml" />
</modules>
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

@ -4,9 +4,7 @@ import (
"bytes"
"fmt"
"objectss/database"
"objectss/utils"
"os/exec"
"strings"
"sync"
)
@ -28,21 +26,21 @@ func Consumer(channel chan string, dbw *database.DbWorker, wg *sync.WaitGroup, o
if ok {
//取出命令执行
if len(path) != 0 {
pathDir := strings.Replace(path, ".git", "", -1)
utils.Log.Info("path:", pathDir, "ComsumerNume:", ComsuNum)
//pathDir := strings.Replace(path, ".git", "", -1)
//utils.Log.Info("path:", pathDir, "ComsumerNume:", ComsuNum)
// 拷贝版本库到oss
ossPath := fmt.Sprintf("%s%s", osslink, pathDir)
copyExec := fmt.Sprintf("obsutil sync %s %s", pathDir, ossPath)
ossPath := fmt.Sprintf("%s%s", osslink, path)
copyExec := fmt.Sprintf("obsutil sync %s %s", path, ossPath)
fmt.Println("shell:", copyExec)
s, err := Exec_linux_shell(copyExec)
utils.Log.Info("copy exec_shell: ", s, " err", err)
// 拷贝完成后,更新数据 oss=1
if err == nil {
dbw.UpdateRepositoryOssbyPath(path)
} else {
utils.Log.Errorf("objectStore upload Failedcommad %s Git Path %s:shell exec return %", copyExec, pathDir, s, " err", err)
}
//s, err := Exec_linux_shell(copyExec)
//utils.Log.Info("copy exec_shell: ", s, " err", err)
//// 拷贝完成后,更新数据 oss=1
//if err == nil {
// dbw.UpdateRepositoryOssbyPath(path)
//} else {
// utils.Log.Errorf("objectStore upload Failedcommad %s Git Path %s:shell exec return %", copyExec, pathDir, s, " err", err)
//}
}
mu.Lock()

Loading…
Cancel
Save