From 2ef87f9de6a4e07cf2e882fb74a1caa23bbcbcc5 Mon Sep 17 00:00:00 2001
From: "scott.wang" <scottwangsxll@gmail.com>
Date: Tue, 19 May 2020 15:54:38 +0800
Subject: [PATCH] Fix dockerfile and build the latest code

---
 .travis.yml                               | 6 ++----
 test/integrate/dubbo/go-client/Dockerfile | 8 ++++++--
 test/integrate/dubbo/go-server/Dockerfile | 7 +++++--
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 3658c7dc2..37dea01a9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,16 +22,14 @@ script:
   - echo ${TRAVIS_PULL_REQUEST_SLUG}
   - echo ${TRAVIS_PULL_REQUEST_SHA}
   - echo ${TRAVIS_REPO_SLUG}
-  - exit 1
   # license-check
   # start zookeeper registry insecure listen in [:]:2181
   - echo 'start integrate-test'
   # start zookeeper registry insecure listen in [:]:2181
   - docker run -d --network host zookeeper
   - ROOTDIR=$(pwd)
-  - echo ${TRAVIS_COMMIT} ${ROOTDIR}
-  - cd ./test/integrate/dubbo/go-client && docker build . -t  ci-consumer --build-arg COMMITID=${TRAVIS_COMMIT} && cd $ROOTDIR
-  - cd ./test/integrate/dubbo/go-server && docker build . -t  ci-provider --build-arg COMMITID=${TRAVIS_COMMIT} && cd $ROOTDIR
+  - cd ./test/integrate/dubbo/go-client && docker build . -t  ci-consumer --build-arg PR_ORIGIN_REPO=${TRAVIS_PULL_REQUEST_SLUG} PR_ORIGIN_COMMITID=${TRAVIS_PULL_REQUEST_SHA} && cd $ROOTDIR
+  - cd ./test/integrate/dubbo/go-server && docker build . -t  ci-provider --build-arg PR_ORIGIN_REPO=${TRAVIS_PULL_REQUEST_SLUG} PR_ORIGIN_COMMITID=${TRAVIS_PULL_REQUEST_SHA} && cd $ROOTDIR
   - docker run -d --network host ci-provider
   - docker run -it --network host ci-consumer
   - exit 0
diff --git a/test/integrate/dubbo/go-client/Dockerfile b/test/integrate/dubbo/go-client/Dockerfile
index cf465b8db..914d4a50b 100644
--- a/test/integrate/dubbo/go-client/Dockerfile
+++ b/test/integrate/dubbo/go-client/Dockerfile
@@ -7,11 +7,15 @@ WORKDIR /go/src/github.com/apache/dubbo-go/test/integrate/dubbo/go-client
 ENV CONF_CONSUMER_FILE_PATH "client.yml"
 ENV APP_LOG_CONF_FILE "log.yml"
 
-ARG COMMITID
+ARG PR_ORIGIN_REPO
+ARG PR_ORIGIN_COMMITID
 
 ADD . /go/src/github.com/apache/dubbo-go/test/integrate/dubbo/go-client
+
 # update dubbo-go to current commit id
-RUN go get -u github.com/apache/dubbo-go@${COMMITID}
+RUN echo "github.com/apache/dubbo-go will be replace to github.com/${PR_ORIGIN_REPO}@${PR_ORIGIN_COMMITID}"
+RUN go mod edit  -replace=github.com/apache/dubbo-go=github.com/${PR_ORIGIN_REPO}@${PR_ORIGIN_COMMITID}
+
 RUN go install github.com/apache/dubbo-go/test/integrate/dubbo/go-client
 
 CMD go-client
\ No newline at end of file
diff --git a/test/integrate/dubbo/go-server/Dockerfile b/test/integrate/dubbo/go-server/Dockerfile
index 80990a142..c981d8a6d 100644
--- a/test/integrate/dubbo/go-server/Dockerfile
+++ b/test/integrate/dubbo/go-server/Dockerfile
@@ -7,11 +7,14 @@ WORKDIR /go/src/github.com/apache/dubbo-go/test/integrate/dubbo/go-server
 ENV CONF_PROVIDER_FILE_PATH "server.yml"
 ENV APP_LOG_CONF_FILE "log.yml"
 
-ARG COMMITID
+ARG PR_ORIGIN_REPO
+ARG PR_ORIGIN_COMMITID
 
 ADD . /go/src/github.com/apache/dubbo-go/test/integrate/dubbo/go-server
 # update dubbo-go to current commit id
-RUN go get -u github.com/apache/dubbo-go@${COMMITID}
+RUN echo "github.com/apache/dubbo-go will be replace to github.com/${PR_ORIGIN_REPO}@${PR_ORIGIN_COMMITID}"
+RUN go mod edit  -replace=github.com/apache/dubbo-go=github.com/${PR_ORIGIN_REPO}@${PR_ORIGIN_COMMITID}
+
 RUN go install github.com/apache/dubbo-go/test/integrate/dubbo/go-server
 
 CMD go-server
-- 
GitLab