You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by la...@apache.org on 2021/09/07 08:14:15 UTC

[dubbo-go-samples] branch config-enhance updated: Rft: reduce docker containers with one dockercompose file (#220)

This is an automated email from the ASF dual-hosted git repository.

laurence pushed a commit to branch config-enhance
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git


The following commit(s) were added to refs/heads/config-enhance by this push:
     new 48628a8  Rft: reduce docker containers with one dockercompose file (#220)
48628a8 is described below

commit 48628a85df129c785f858ac0c19566f20d6a3163
Author: Jason Peng <lv...@gmail.com>
AuthorDate: Tue Sep 7 16:12:32 2021 +0800

    Rft: reduce docker containers with one dockercompose file (#220)
    
    * Rft: reduce docker containers with one dockercompose file
    
    * remove docker container start and stop cmd in makefile
    
    * address comment
    
    * rename docker folder
    
    * add comment
    
    * add etcd service in dockercompose file
---
 integrate_test.sh                               |  4 ---
 integrate_test/dockercompose/docker-compose.yml | 41 +++++++++++++++++++++++++
 start_integrate_test.sh                         |  6 ++++
 3 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/integrate_test.sh b/integrate_test.sh
index 8894871..ff2747c 100755
--- a/integrate_test.sh
+++ b/integrate_test.sh
@@ -28,8 +28,6 @@ fi
 
 INTEGRATE_DIR=$(pwd)/integrate_test/$1
 
-make PROJECT_DIR="$P_DIR" PROJECT_NAME="$(basename "$P_DIR")" INTEGRATE_DIR="$INTEGRATE_DIR" -f build/Makefile docker-up
-
 # check docker health
 make PROJECT_DIR="$P_DIR" PROJECT_NAME="$(basename "$P_DIR")" INTEGRATE_DIR="$INTEGRATE_DIR" -f build/Makefile docker-health-check
 
@@ -48,6 +46,4 @@ fi
 # stop server
 make PROJECT_DIR="$P_DIR" PROJECT_NAME="$(basename "$P_DIR")" INTEGRATE_DIR="$INTEGRATE_DIR" -f build/Makefile clean
 
-make PROJECT_DIR="$P_DIR" PROJECT_NAME="$(basename "$P_DIR")" INTEGRATE_DIR="$INTEGRATE_DIR" -f build/Makefile docker-down
-
 exit $((result))
\ No newline at end of file
diff --git a/integrate_test/dockercompose/docker-compose.yml b/integrate_test/dockercompose/docker-compose.yml
new file mode 100644
index 0000000..f93f6db
--- /dev/null
+++ b/integrate_test/dockercompose/docker-compose.yml
@@ -0,0 +1,41 @@
+version: '3'
+
+# services config in one docker-compose file for integrate test
+# integrate test will start up services and samples test will depend on those containers
+services:
+  zookeeper:
+    image: zookeeper
+    ports:
+      - "2181:2181"
+    restart: on-failure
+
+  nacos:
+    image: nacos/nacos-server:1.2.0
+    container_name: nacos-standalone
+    environment:
+      - PREFER_HOST_MODE=hostname
+      - MODE=standalone
+    ports:
+      - "8848:8848"
+    healthcheck:
+      test: "curl --fail http://127.0.0.1:8848/nacos/v1/console/health/liveness || exit 1"
+      interval: 5s
+
+  etcd:
+    image: "quay.io/coreos/etcd:latest"
+    container_name: etcd
+    environment:
+      - ETCDCTL_API=3
+    command: [
+        "etcd",
+        "--name=etcd0",
+        "--advertise-client-urls=http://127.0.0.1:2379",
+        "--listen-client-urls=http://0.0.0.0:2379",
+        "--initial-advertise-peer-urls=http://127.0.0.1:2380",
+        "--listen-peer-urls=http://0.0.0.0:2380",
+        "--initial-cluster=etcd0=http://127.0.0.1:2380",
+    ]
+    ports:
+      - "2379:2379"
+      - "2380:2380"
+    restart: always
diff --git a/start_integrate_test.sh b/start_integrate_test.sh
index a13326c..e7d02c6 100755
--- a/start_integrate_test.sh
+++ b/start_integrate_test.sh
@@ -90,6 +90,8 @@
 #array+=("router/uniform-router/file/go-server2")
 
 # unclassified
+DOCKER_DIR=$(pwd)/integrate_test/dockercompose
+
 array=("helloworld")
 array+=("direct")
 # config-api
@@ -104,11 +106,15 @@ array+=("rpc/triple/codec-extension")
 array+=("rpc/triple/hessian2")
 array+=("rpc/triple/pb/dubbogo-grpc")
 
+docker-compose -f $DOCKER_DIR/docker-compose.yml up -d
+
 for((i=0;i<${#array[*]};i++))
 do
 	./integrate_test.sh "${array[i]}"
 	result=$?
 	if [ $result -gt 0 ]; then
+	      docker-compose -f $DOCKER_DIR/docker-compose.yml down
         exit $result
 	fi
 done
+docker-compose -f $DOCKER_DIR/docker-compose.yml down