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

bzp2010 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 aa007b9  refactor(ci): test before push to docker hub (#358)
aa007b9 is described below

commit aa007b98cd563e6d7819d12c9aface65af97b8b5
Author: soulbird <[email protected]>
AuthorDate: Tue Sep 20 11:50:44 2022 +0800

    refactor(ci): test before push to docker hub (#358)
    
    Co-authored-by: soulbird <[email protected]>
---
 .github/workflows/apisix-docker-dev-test.yaml     | 65 -----------------------
 .github/workflows/apisix-docker-test.yaml         | 65 -----------------------
 .github/workflows/apisix_dev_push_docker_hub.yaml | 33 ++++++++++++
 .github/workflows/apisix_push_docker_hub.yaml     | 48 +++++++++++++++--
 .github/workflows/dashboard-docker-test.yaml      | 47 ----------------
 .github/workflows/dashboard_push_docker_hub.yaml  | 34 ++++++++++++
 6 files changed, 111 insertions(+), 181 deletions(-)

diff --git a/.github/workflows/apisix-docker-dev-test.yaml 
b/.github/workflows/apisix-docker-dev-test.yaml
deleted file mode 100644
index b254473..0000000
--- a/.github/workflows/apisix-docker-dev-test.yaml
+++ /dev/null
@@ -1,65 +0,0 @@
-name: APISIX Docker dev Test
-
-on:
-  schedule:
-    - cron: "0 1 * * *"
-  push:
-    branches: [master]
-    paths-ignore:
-      - 'docs/**'
-      - '**/*.md'
-
-jobs:
-  build:
-    strategy:
-      fail-fast: false
-      matrix:
-        platform:
-          - debian-dev
-
-    runs-on: ubuntu-latest
-    env:
-      APISIX_VERSION: master
-      APISIX_DOCKER_TAG: master-${{ matrix.platform }}
-    steps:
-      - uses: actions/checkout@v2
-
-      - name: Build and run
-        run: |
-          make build-on-${{ matrix.platform }}
-          docker-compose -f ./compose/docker-compose-master.yaml up -d
-          sleep 30
-          docker logs compose_apisix_1
-
-      - name: Test
-        run: |
-          grep -C 3 '\[error\]' compose/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": {
-                    "httpbin.org: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
-
-      - name: Tar Image
-        if: ${{ !endsWith(matrix.platform, '-local') && 
!endsWith(matrix.platform, '-dev')  }}
-        run: |
-          make save-${{ matrix.platform }}-tar
-
-      - name: Upload Image
-        if: ${{ !endsWith(matrix.platform, '-local') && 
!endsWith(matrix.platform, '-dev')  }}
-        uses: actions/upload-artifact@v2
-        with:
-          path: ./package
diff --git a/.github/workflows/apisix-docker-test.yaml 
b/.github/workflows/apisix-docker-test.yaml
deleted file mode 100644
index 95f1025..0000000
--- a/.github/workflows/apisix-docker-test.yaml
+++ /dev/null
@@ -1,65 +0,0 @@
-name: APISIX Docker Test
-
-on:
-  push:
-    branches:
-      - master
-  pull_request:
-    branches:
-      - master
-
-jobs:
-  build:
-    strategy:
-      fail-fast: false
-      matrix:
-        platform:
-          - alpine
-          - centos
-          - debian
-
-    runs-on: ubuntu-latest
-    env:
-      APISIX_DOCKER_TAG: 2.15.0-${{ matrix.platform }}
-    steps:
-      - uses: actions/checkout@v2
-
-      - name: Build and run
-        run: |
-          make build-on-${{ matrix.platform }}
-          docker-compose -f ./compose/docker-compose-release.yaml up -d
-          sleep 30
-          docker logs compose_apisix_1
-
-      - name: Test
-        run: |
-          grep -C 3 '\[error\]' compose/apisix_log/error.log && exit 1
-
-          curl http://127.0.0.1:9080/apisix/admin/routes/1 \
-          -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-            {
-            "uri": "/get",
-            "upstream": {
-                "type": "roundrobin",
-                "nodes": {
-                    "httpbin.org: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
-
-      - name: Tar Image
-        if: ${{ !endsWith(matrix.platform, '-local') && 
!endsWith(matrix.platform, '-dev')  }}
-        run: |
-          make save-${{ matrix.platform }}-tar
-
-      - name: Upload Image
-        if: ${{ !endsWith(matrix.platform, '-local') && 
!endsWith(matrix.platform, '-dev')  }}
-        uses: actions/upload-artifact@v2
-        with:
-          path: ./package
diff --git a/.github/workflows/apisix_dev_push_docker_hub.yaml 
b/.github/workflows/apisix_dev_push_docker_hub.yaml
index 412206b..38a0399 100644
--- a/.github/workflows/apisix_dev_push_docker_hub.yaml
+++ b/.github/workflows/apisix_dev_push_docker_hub.yaml
@@ -15,10 +15,43 @@ jobs:
   build:
     runs-on: ubuntu-latest
 
+    env:
+      APISIX_VERSION: master
+      APISIX_DOCKER_TAG: master-debian-dev
+
     steps:
       - name: Check out the repo
         uses: actions/checkout@v2
 
+      - name: Build and run
+        run: |
+          make build-on-debian-dev
+          docker-compose -f ./compose/docker-compose-master.yaml up -d
+          sleep 30
+          docker logs compose_apisix_1
+
+      - name: Test APISIX
+        run: |
+          grep -C 3 '\[error\]' compose/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": {
+                    "httpbin.org: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
+
       - name: Login to Docker Hub
         uses: docker/login-action@v1
         with:
diff --git a/.github/workflows/apisix_push_docker_hub.yaml 
b/.github/workflows/apisix_push_docker_hub.yaml
index e9e5f84..39a340f 100644
--- a/.github/workflows/apisix_push_docker_hub.yaml
+++ b/.github/workflows/apisix_push_docker_hub.yaml
@@ -2,14 +2,52 @@ name: Push apisix to Docker image
 on:
   push:
     branches: ['release/apisix-**']
+
 jobs:
   build:
     runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        platform:
+          - centos
+          - debian
+    env:
+      APISIX_DOCKER_TAG: 2.15.0-${{ matrix.platform }}
 
     steps:
       - name: Check out the repo
         uses: actions/checkout@v2
 
+      - name: Build and run
+        run: |
+          make build-on-${{ matrix.platform }}
+          docker-compose -f ./compose/docker-compose-release.yaml up -d
+          sleep 30
+          docker logs compose_apisix_1
+
+      - name: Test route
+        run: |
+          grep -C 3 '\[error\]' compose/apisix_log/error.log && exit 1
+
+          curl http://127.0.0.1:9080/apisix/admin/routes/1 \
+          -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+            {
+            "uri": "/get",
+            "upstream": {
+                "type": "roundrobin",
+                "nodes": {
+                    "httpbin.org: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
+
       - name: Login to Docker Hub
         uses: docker/login-action@v1
         with:
@@ -22,9 +60,11 @@ jobs:
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v1
 
-      - name: Push apisix image to Docker Hub
+      - name: push apisix:latest image to docker hub
+        if: matrix.platform == 'debian'
         run: |
-          make push-multiarch-on-debian
-          make push-multiarch-on-alpine
-          make push-multiarch-on-centos
           make push-multiarch-on-latest
+
+      - name: Push apisix:${{ matrix.os }} image to Docker Hub
+        run: |
+          make push-multiarch-on-${{ matrix.platform }}
diff --git a/.github/workflows/dashboard-docker-test.yaml 
b/.github/workflows/dashboard-docker-test.yaml
deleted file mode 100644
index b3e82bc..0000000
--- a/.github/workflows/dashboard-docker-test.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-name: dashboard docker test
-
-on:
-  push:
-    branches:
-      - master
-  pull_request:
-    branches:
-      - master
-
-jobs:
-  dashboard-docker-test:
-    strategy:
-      fail-fast: false
-      matrix:
-        os:
-          - centos
-          - alpine
-    name: build dashboard & test on ${{ matrix.os }}
-    runs-on: ubuntu-latest
-    env:
-      APISIX_DASHBOARD_TAG: "2.13"
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v2
-
-      - name: Build and run
-        run: |
-          make build-dashboard-${{ matrix.os }}
-          docker-compose -f ./compose/dashboard-compose.yaml up -d
-          sleep 30
-          docker logs compose_dashboard_1
-
-      - name: check
-        run: |
-          wget 
https://raw.githubusercontent.com/apache/apisix-dashboard/master/api/test/shell/manager_smoking.sh
-          chmod +x ./manager_smoking.sh
-          sh manager_smoking.sh -s true
-
-      - name: Tar Image
-        run: |
-          make save-dashboard-${{ matrix.os }}-tar
-
-      - name: Upload Image
-        uses: actions/upload-artifact@v2
-        with:
-          path: ./package
diff --git a/.github/workflows/dashboard_push_docker_hub.yaml 
b/.github/workflows/dashboard_push_docker_hub.yaml
index 4d9a432..9444c59 100644
--- a/.github/workflows/dashboard_push_docker_hub.yaml
+++ b/.github/workflows/dashboard_push_docker_hub.yaml
@@ -4,12 +4,45 @@ on:
     branches: ['release/apisix-dashboard**']
 jobs:
   build:
+    strategy:
+        fail-fast: false
+        matrix:
+          os:
+            - centos
+            - alpine
+
+    name: build dashboard & test on ${{ matrix.os }} && push to docker hub
     runs-on: ubuntu-latest
 
+    env:
+      APISIX_DASHBOARD_TAG: "2.13"
+
     steps:
       - name: Check out the repo
         uses: actions/checkout@v2
 
+            - name: Build and run
+        run: |
+          make build-dashboard-${{ matrix.os }}
+          docker-compose -f ./compose/dashboard-compose.yaml up -d
+          sleep 30
+          docker logs compose_dashboard_1
+
+      - name: check
+        run: |
+          wget 
https://raw.githubusercontent.com/apache/apisix-dashboard/master/api/test/shell/manager_smoking.sh
+          chmod +x ./manager_smoking.sh
+          sh manager_smoking.sh -s true
+
+      - name: Tar Image
+        run: |
+          make save-dashboard-${{ matrix.os }}-tar
+
+      - name: Upload Image
+        uses: actions/upload-artifact@v2
+        with:
+          path: ./package
+
       - name: Login to Docker Hub
         uses: docker/login-action@v1
         with:
@@ -23,5 +56,6 @@ jobs:
         uses: docker/setup-buildx-action@v1
 
       - name: Push apisix dashboard image to Docker Hub
+        if: matrix.platform == 'centos'
         run: |
           make push-multiarch-dashboard

Reply via email to