Skip to content

Commit

Permalink
Add docker test
Browse files Browse the repository at this point in the history
  • Loading branch information
abericyang@gmail.com committed May 16, 2019
1 parent ac444b3 commit 0eb8fa3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 deletions.
13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.

11 changes: 11 additions & 0 deletions bow/runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.12.3 as builder
LABEL app="rivet" by="ennoo"
ENV REPO=$GOPATH/src/github.com/ennoo/rivet
WORKDIR $REPO
RUN git clone https://github.com/ennoo/rivet.git ../rivet
RUN go build -o $REPO/bow/runner/bowtest $REPO/bow/runner/bow.go
FROM centos:latest
WORKDIR /root/
COPY --from=builder /go/src/github.com/ennoo/rivet/bow/runner/bowtest .
EXPOSE 19219
CMD ./bowtest
6 changes: 5 additions & 1 deletion bow/runner/bow.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,9 @@ func main() {
rivet.ListenAndServe(&rivet.ListenServe{
Engine: rivet.SetupRouter(),
DefaultPort: "19219",
}, strings.Join([]string{env.GetEnv(env.GOPath), "/src/github.com/ennoo/rivet/examples/tls/rootCA.crt"}, ""))
})
//rivet.ListenAndServe(&rivet.ListenServe{
// Engine: rivet.SetupRouter(),
// DefaultPort: "19219",
//}, strings.Join([]string{env.GetEnv(env.GOPath), "/src/github.com/ennoo/rivet/examples/tls/rootCA.crt"}, ""))
}
22 changes: 12 additions & 10 deletions trans/request/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,18 @@ func (t *TPort) Timeout(connectTimeout, keepAlive time.Duration) *TPort {
//
// caCertPaths 作为客户端发起 HTTPS 请求时所需客户端证书路径数组
func (t *TPort) RootCACerts(caCertPaths []string) *TPort {
for index := range caCertPaths {
caCertPath := caCertPaths[index]
if caCrt, err := ioutil.ReadFile(caCertPath); err == nil {
//将生成的数字证书添加到数字证书集合中
t.Pool.AppendCertsFromPEM(caCrt)
} else {
log.Trans.Fatal("can't read file with path",
zap.String("path", caCertPath),
zap.Error(err),
zap.Int("code", log.ReadFileForCACertFail))
if len(caCertPaths) > 0 {
for index := range caCertPaths {
caCertPath := caCertPaths[index]
if caCrt, err := ioutil.ReadFile(caCertPath); err == nil {
//将生成的数字证书添加到数字证书集合中
t.Pool.AppendCertsFromPEM(caCrt)
} else {
log.Trans.Fatal("can't read file with path",
zap.String("path", caCertPath),
zap.Error(err),
zap.Int("code", log.ReadFileForCACertFail))
}
}
}
return t
Expand Down

0 comments on commit 0eb8fa3

Please sign in to comment.