Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy: use goproxy.cn and clarify private org #269

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ RUN mkdir -p /root/.ssh && chown -R root /root/.ssh/ && chgrp -R root /root/.ss
COPY deploy/config /root/.ssh/config
COPY deploy/github-known-hosts /github_known_hosts

# set go proxy and private repo
RUN go env -w GOPROXY=https://goproxy.cn,direct \
&& go env -w GOPRIVATE=github.com/qbox

EXPOSE 8888

ENTRYPOINT [ "/reviewbot" ]
10 changes: 5 additions & 5 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,19 @@ func (s *Server) handle(log *xlog.Logger, ctx context.Context, event *github.Pul
return err
}

gitmodulespath := path.Join(r.Directory(), ".gitmodules")
_, err = os.Stat(gitmodulespath)
gitModulesFile := path.Join(r.Directory(), ".gitmodules")
_, err = os.Stat(gitModulesFile)
if err == nil {
log.Info("git pull submodule in progress")
cmd := exec.Command("git", "submodule", "update", "--init", "--recursive")
cmd.Dir = r.Directory()
out, err := cmd.CombinedOutput()
if err != nil {
log.Errorf("git pull submodule meet something wrong ,marked and continue , details :%v ", err)
log.Errorf("error when git pull submodule, marked and continue, details :%v ", err)
}
log.Infof("submodule details: %s ", out)
log.Infof("git pull submodule output: %s ", out)
} else {
log.Infof("repo %s can not find the .gitmodules file", repo)
log.Infof("no .gitmodules file in repo %s", repo)
}

defer func() {
Expand Down
Loading