You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by so...@apache.org on 2022/09/19 02:21:40 UTC

[apisix-docker] branch master updated: reactor(ci): reactor ci for example compose (#356)

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

soulbird pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-docker.git


The following commit(s) were added to refs/heads/master by this push:
     new 38a6e82  reactor(ci): reactor ci for example compose (#356)
38a6e82 is described below

commit 38a6e82a8fddfc6f99500f41713fb935e7af5ce5
Author: soulbird <zh...@outlook.com>
AuthorDate: Mon Sep 19 10:21:36 2022 +0800

    reactor(ci): reactor ci for example compose (#356)
    
    * reactor(ci): reactor ci for example compose
    
    Co-authored-by: soulbird <zh...@gmail.com>
---
 .github/workflows/apisix-docker-example-test.yaml | 41 +++++++++++
 .github/workflows/linux_alpine_ci.yaml            | 15 ----
 .github/workflows/linux_ci.yml                    | 15 ----
 example/docker-compose-alpine.yml                 | 88 -----------------------
 example/docker-compose.yml                        |  2 +-
 5 files changed, 42 insertions(+), 119 deletions(-)

diff --git a/.github/workflows/apisix-docker-example-test.yaml b/.github/workflows/apisix-docker-example-test.yaml
new file mode 100644
index 0000000..55c709b
--- /dev/null
+++ b/.github/workflows/apisix-docker-example-test.yaml
@@ -0,0 +1,41 @@
+name: Docker compose CI for example
+
+on:
+  schedule:
+    - cron: "0 1 * * *"
+  push:
+    branches: [master]
+    paths-ignore:
+      - 'docs/**'
+      - '**/*.md'
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: use docker-compose
+        run: cd ./example && docker-compose -p docker-apisix up -d
+
+      - name: Test APISIX
+        run: |
+          grep -C 3 '\[error\]' example/apisix_log/error.log && exit 1
+
+          curl http://127.0.0.1:9180/apisix/admin/routes/1 \
+          -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+            {
+            "uri": "/get",
+            "upstream": {
+                "type": "roundrobin",
+                "nodes": {
+                    "web1:80": 1
+                }
+            }
+          }'
+
+          result_code=`curl -I -m 10 -o /dev/null -s -w %{http_code} http://127.0.0.1:9080/get`
+          if [[ $result_code -ne 200 ]];then
+                  printf "result_code: %s\n" "$result_code"
+                  exit 125
+          fi
\ No newline at end of file
diff --git a/.github/workflows/linux_alpine_ci.yaml b/.github/workflows/linux_alpine_ci.yaml
deleted file mode 100644
index 7239ce5..0000000
--- a/.github/workflows/linux_alpine_ci.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-name: Docker compose alpine CI on linux
-
-on:
-  push:
-    branches: [ master, kv/alpine ]
-  pull_request:
-    branches: [ master ]
-
-jobs:
-  build:
-    runs-on: ubuntu-latest
-    steps:
-    - uses: actions/checkout@v2
-    - name: use docker-compose
-      run: cd ./example && docker-compose -f docker-compose-alpine.yml -p docker-apisix up -d
diff --git a/.github/workflows/linux_ci.yml b/.github/workflows/linux_ci.yml
deleted file mode 100644
index dc15281..0000000
--- a/.github/workflows/linux_ci.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-name: Docker compose CI on linux
-
-on:
-  push:
-    branches: [ master ]
-  pull_request:
-    branches: [ master ]
-
-jobs:
-  build:
-    runs-on: ubuntu-latest
-    steps:
-    - uses: actions/checkout@v2
-    - name: use docker-compose
-      run: cd ./example && docker-compose -p docker-apisix up -d
diff --git a/example/docker-compose-alpine.yml b/example/docker-compose-alpine.yml
deleted file mode 100644
index 6b94b21..0000000
--- a/example/docker-compose-alpine.yml
+++ /dev/null
@@ -1,88 +0,0 @@
-#
-# 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: "3"
-
-services:
-  apisix:
-    build:
-      context: ./..
-      dockerfile: alpine/Dockerfile
-      args:
-        APISIX_VERSION: master
-    restart: always
-    volumes:
-      - ./apisix_log:/usr/local/apisix/logs
-      - ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
-    depends_on:
-      - etcd
-    ports:
-      - "9080:9080/tcp"
-      - "9091:9091/tcp"
-      - "9443:9443/tcp"
-      - "9092:9092/tcp"
-    networks:
-      apisix:
-
-  etcd:
-    image: bitnami/etcd:3.4.9
-    restart: always
-    volumes:
-      - etcd_data:/bitnami/etcd
-    environment:
-      ETCD_DATA_DIR: /etcd_data
-      ETCD_ENABLE_V2: "true"
-      ALLOW_NONE_AUTHENTICATION: "yes"
-      ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
-      ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
-    ports:
-      - "2379:2379/tcp"
-    networks:
-      apisix:
-
-  web1:
-    image: nginx:1.18.0-alpine
-    restart: always
-    volumes:
-      - ./upstream/web1.conf:/etc/nginx/nginx.conf
-    ports:
-      - "9081:80/tcp"
-    environment:
-      - NGINX_PORT=80
-    networks:
-      apisix:
-
-  web2:
-    image: nginx:1.18.0-alpine
-    restart: always
-    volumes:
-      - ./upstream/web2.conf:/etc/nginx/nginx.conf
-    ports:
-      - "9082:80/tcp"
-    environment:
-      - NGINX_PORT=80
-    networks:
-      apisix:
-
-networks:
-  apisix:
-    driver: bridge
-
-volumes:
-  etcd_data:
-    driver: local
-
diff --git a/example/docker-compose.yml b/example/docker-compose.yml
index aa8bd01..da30238 100644
--- a/example/docker-compose.yml
+++ b/example/docker-compose.yml
@@ -29,7 +29,7 @@ services:
       apisix:
 
   apisix:
-    image: apache/apisix:2.15.0-alpine
+    image: apache/apisix:2.15.0-debian
     restart: always
     volumes:
       - ./apisix_log:/usr/local/apisix/logs