Skip to content
Snippets Groups Projects
Commit f9368d50 authored by scott.wang's avatar scott.wang
Browse files

Add extra logic for Dockerfile

parent 9190c53d
No related branches found
No related tags found
No related merge requests found
...@@ -51,11 +51,22 @@ echo "travis pull request repo slug -> ${TRAVIS_REPO_SLUG}" ...@@ -51,11 +51,22 @@ echo "travis pull request repo slug -> ${TRAVIS_REPO_SLUG}"
docker run -d --network host zookeeper docker run -d --network host zookeeper
echo "zookeeper listen in [:]2181" echo "zookeeper listen in [:]2181"
# fast fail if [ ${TRAVIS_PULL_REQUEST_SLUG} ]
exit 1 then
# this is a pull-request commit
# build go-client image
cd ./test/integrate/dubbo/go-client && docker build . -t ci-consumer --build-arg PR_ORIGIN_REPO=${TRAVIS_PULL_REQUEST_SLUG} --build-arg PR_ORIGIN_COMMITID=${TRAVIS_PULL_REQUEST_SHA} && cd ${ROOT_DIR} cd ./test/integrate/dubbo/go-client
cd ./test/integrate/dubbo/go-server && docker build . -t ci-provider --build-arg PR_ORIGIN_REPO=${TRAVIS_PULL_REQUEST_SLUG} --build-arg PR_ORIGIN_COMMITID=${TRAVIS_PULL_REQUEST_SHA} && cd ${ROOT_DIR} docker build . -t ci-consumer --build-arg PR_ORIGIN_REPO=${TRAVIS_PULL_REQUEST_SLUG} --build-arg PR_ORIGIN_COMMITID=${TRAVIS_PULL_REQUEST_SHA}
docker run -d --network host ci-provider cd ${ROOT_DIR}
docker run -it --network host ci-consumer # build go-server image
cd ./test/integrate/dubbo/go-server
docker build . -t ci-provider --build-arg PR_ORIGIN_REPO=${TRAVIS_PULL_REQUEST_SLUG} --build-arg PR_ORIGIN_COMMITID=${TRAVIS_PULL_REQUEST_SHA}
cd ${ROOT_DIR}
# run provider
docker run -d --network host ci-provider
# check consumer status
docker run -it --network host ci-consumer
else
# this is merge pull-request to local-repo
echo ''
fi
...@@ -28,8 +28,8 @@ ARG PR_ORIGIN_COMMITID ...@@ -28,8 +28,8 @@ ARG PR_ORIGIN_COMMITID
ADD . /go/src/github.com/apache/dubbo-go/test/integrate/dubbo/go-client ADD . /go/src/github.com/apache/dubbo-go/test/integrate/dubbo/go-client
# update dubbo-go to current commit id # update dubbo-go to current commit id
RUN echo "github.com/apache/dubbo-go will be replace to github.com/${PR_ORIGIN_REPO}@${PR_ORIGIN_COMMITID}" RUN test ${PR_ORIGIN_REPO} && 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 test ${PR_ORIGIN_REPO} && 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 RUN go install github.com/apache/dubbo-go/test/integrate/dubbo/go-client
......
...@@ -27,8 +27,8 @@ ARG PR_ORIGIN_COMMITID ...@@ -27,8 +27,8 @@ ARG PR_ORIGIN_COMMITID
ADD . /go/src/github.com/apache/dubbo-go/test/integrate/dubbo/go-server ADD . /go/src/github.com/apache/dubbo-go/test/integrate/dubbo/go-server
# update dubbo-go to current commit id # update dubbo-go to current commit id
RUN echo "github.com/apache/dubbo-go will be replace to github.com/${PR_ORIGIN_REPO}@${PR_ORIGIN_COMMITID}" RUN test ${PR_ORIGIN_REPO} && cho "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 test ${PR_ORIGIN_REPO} && o 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 RUN go install github.com/apache/dubbo-go/test/integrate/dubbo/go-server
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment