You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/06/12 07:49:09 UTC
[GitHub] eric-lee-ltk closed pull request #208: SCB-660 seperate alpha with
other services in docker compose
eric-lee-ltk closed pull request #208: SCB-660 seperate alpha with other services in docker compose
URL: https://github.com/apache/incubator-servicecomb-saga/pull/208
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/saga-demo/saga-dubbo-demo/docker-compose-alpha.yaml b/saga-demo/saga-dubbo-demo/docker-compose-alpha.yaml
new file mode 100644
index 00000000..a664c238
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/docker-compose-alpha.yaml
@@ -0,0 +1,48 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+version: '2.1'
+
+services:
+ database:
+ image: "postgres"
+ hostname: postgres
+ environment:
+ - POSTGRES_DB=saga
+ - POSTGRES_USER=saga
+ - POSTGRES_PASSWORD=password
+ healthcheck:
+ test: ["CMD-SHELL", "nc -z localhost 5432 &> /dev/null; echo $$?"]
+ interval: 30s
+ timeout: 10s
+ retries: 5
+
+ alpha:
+ image: "alpha-server:${TAG}"
+ hostname: alpha-server
+ links:
+ - "database:postgresql.servicecomb.io"
+ environment:
+ - JAVA_OPTS=-Dspring.profiles.active=prd
+ healthcheck:
+ test: ["CMD-SHELL", "nc -z localhost 8080 &> /dev/null; echo $$?"]
+ interval: 30s
+ timeout: 10s
+ retries: 5
+ depends_on:
+ database:
+ condition: service_healthy
diff --git a/saga-demo/saga-dubbo-demo/docker-compose-demo.yaml b/saga-demo/saga-dubbo-demo/docker-compose-demo.yaml
new file mode 100644
index 00000000..2890cedd
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/docker-compose-demo.yaml
@@ -0,0 +1,84 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+version: '2.1'
+
+services:
+ zookeeper:
+ image: "docker.io/zookeeper"
+ hostname: zookeeper
+ ports:
+ - "2181:2181"
+ servicea:
+ image: "servicea:${TAG}"
+ hostname: servicea
+ links:
+ - "zookeeper:zookeeper.servicecomb.io"
+ external_links:
+ - "alpha:alpha-server.servicecomb.io"
+ - "database:postgresql.servicecomb.io"
+ environment:
+ - JAVA_OPTS= -Dspring.profiles.active=prd
+ -Dspring.datasource.url=jdbc:postgresql://postgresql.servicecomb.io:5432/saga
+ -Dspring.datasource.username=saga
+ -Dspring.datasource.password=password
+ -Dzookeeper.url=zookeeper.servicecomb.io:2181
+ -Dserver.port=8071
+ -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+ -Dspring.datasource.initialization-mode=always
+ ports:
+ - "8071:8071"
+
+ serviceb:
+ image: "serviceb:${TAG}"
+ hostname: serviceb
+ links:
+ - "zookeeper:zookeeper.servicecomb.io"
+ external_links:
+ - "alpha:alpha-server.servicecomb.io"
+ - "database:postgresql.servicecomb.io"
+ environment:
+ - JAVA_OPTS= -Dspring.profiles.active=prd
+ -Dspring.datasource.url=jdbc:postgresql://postgresql.servicecomb.io:5432/saga
+ -Dspring.datasource.username=saga
+ -Dspring.datasource.password=password
+ -Dzookeeper.url=zookeeper.servicecomb.io:2181
+ -Dserver.port=8072
+ -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+ -Dspring.datasource.initialization-mode=always
+ ports:
+ - "8072:8072"
+
+ servicec:
+ image: "servicec:${TAG}"
+ hostname: servicec
+ links:
+ - "zookeeper:zookeeper.servicecomb.io"
+ external_links:
+ - "alpha:alpha-server.servicecomb.io"
+ - "database:postgresql.servicecomb.io"
+ environment:
+ - JAVA_OPTS= -Dspring.profiles.active=prd
+ -Dspring.datasource.url=jdbc:postgresql://postgresql.servicecomb.io:5432/saga
+ -Dspring.datasource.username=saga
+ -Dspring.datasource.password=password
+ -Dzookeeper.url=zookeeper.servicecomb.io:2181
+ -Dserver.port=8073
+ -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+ -Dspring.datasource.initialization-mode=always
+ ports:
+ - "8073:8073"
diff --git a/saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh b/saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh
index d0138df4..4db8f089 100755
--- a/saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh
+++ b/saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh
@@ -18,7 +18,7 @@
service=saga-dubbo-demo
show_usage() {
- echo "Usage: $0 {up|up-mysql|down}" >&2
+ echo "Usage: $0 {up|up-alpha|up-demo|up-mysql|down}" >&2
}
fetch_version() {
@@ -37,7 +37,21 @@ case $1 in
TAG=$version docker-compose up
exit $?
;;
-
+
+ up-alpha)
+ fetch_version
+ echo "Starting ${service}:${version}"
+ TAG=$version docker-compose -f docker-compose-alpha.yaml up
+ exit $?
+ ;;
+
+ up-demo)
+ fetch_version
+ echo "Starting ${service}:${version}"
+ TAG=$version docker-compose -f docker-compose-demo.yaml up
+ exit $?
+ ;;
+
up-mysql)
fetch_version
echo "Starting ${service}:${version}"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services