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

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git


The following commit(s) were added to refs/heads/master by this push:
     new bd32dea  SCB-573 Split the docker-compose file for debugging easily 
(#190)
bd32dea is described below

commit bd32deaa73be881a3c46604b62f3561319d8a31e
Author: longchun <longc...@gmail.com>
AuthorDate: Mon May 14 18:21:48 2018 +0800

    SCB-573 Split the docker-compose file for debugging easily (#190)
    
    * SCB-573 Split the docker-compose file for debugging easily
    
    * SCB-573 Split the docker-compose file for debugging easily
---
 saga-demo/booking/README.md                 | 12 +++++++-
 saga-demo/booking/docker-compose-alpha.yaml | 48 +++++++++++++++++++++++++++++
 saga-demo/booking/docker-compose-demo.yaml  | 48 +++++++++++++++++++++++++++++
 saga-demo/booking/saga-demo.sh              | 18 +++++++++--
 4 files changed, 123 insertions(+), 3 deletions(-)

diff --git a/saga-demo/booking/README.md b/saga-demo/booking/README.md
index 1540e29..161f886 100644
--- a/saga-demo/booking/README.md
+++ b/saga-demo/booking/README.md
@@ -26,7 +26,7 @@ You can run the demo using either docker compose or 
executable files.
    mvn clean package -DskipTests -Pdocker -Pdemo
    ```
 
-2. start application up
+2. start the whole application up(including alpha server and three demo 
services)
    ```
    ./saga-demo.sh up
    ```
@@ -52,6 +52,16 @@ You can run the demo using either docker compose or 
executable files.
       ./saga-demo.sh up-mysql
       ```
 
+   **Note:** If you want start alpha server and demon services separatelly, 
you can try the following steps:
+   1. start alpha server
+      ```bash
+          ./saga-demo.sh up-alpha
+      ```
+   2. when alpha server started complatelly, then start the demo services
+      ```bash
+          ./saga-demo.sh up-demo
+      ```
+
 3. stop application
    ```
    ./saga-demo.sh down
diff --git a/saga-demo/booking/docker-compose-alpha.yaml 
b/saga-demo/booking/docker-compose-alpha.yaml
new file mode 100644
index 0000000..a664c23
--- /dev/null
+++ b/saga-demo/booking/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/booking/docker-compose-demo.yaml 
b/saga-demo/booking/docker-compose-demo.yaml
new file mode 100644
index 0000000..b1d6639
--- /dev/null
+++ b/saga-demo/booking/docker-compose-demo.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:
+  pack-hotel:
+    image: "pack-hotel:${TAG}"
+    hostname: pack-hotel
+    external_links:
+      - "alpha:alpha-server.servicecomb.io"
+    ports:
+      - "8081:8080"
+
+  pack-car:
+    image: "pack-car:${TAG}"
+    hostname: pack-car
+    external_links:
+      - "alpha:alpha-server.servicecomb.io"
+    ports:
+      - "8082:8080"
+
+  pack-booking:
+    image: "pack-booking:${TAG}"
+    hostname: pack-booking
+    external_links:
+      - "alpha:alpha-server.servicecomb.io"
+      - "pack-hotel:pack-hotel.servicecomb.io"
+      - "pack-car:pack-car.servicecomb.io"
+    ports:
+      - "8083:8080"
+    depends_on:
+      - pack-hotel
+      - pack-car
diff --git a/saga-demo/booking/saga-demo.sh b/saga-demo/booking/saga-demo.sh
index 8e4f464..5379fd5 100755
--- a/saga-demo/booking/saga-demo.sh
+++ b/saga-demo/booking/saga-demo.sh
@@ -3,7 +3,7 @@
 service=saga-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() {
@@ -22,7 +22,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}"

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.

Reply via email to