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 89a4e9f ci: add build image (#426)
89a4e9f is described below
commit 89a4e9fdde139a5f3f86b1963fc1629c5c81cd29
Author: Xin Rong <[email protected]>
AuthorDate: Tue Feb 14 09:54:09 2023 +0800
ci: add build image (#426)
---------
Co-authored-by: rongxin <[email protected]>
---
.github/workflows/apisix-docker-example-test.yaml | 41 +++++++++++++++++++++--
.github/workflows/apisix_all_in_one_ci.yaml | 22 ------------
example/docker-compose.yml | 2 +-
3 files changed, 39 insertions(+), 26 deletions(-)
diff --git a/.github/workflows/apisix-docker-example-test.yaml
b/.github/workflows/apisix-docker-example-test.yaml
index 082fd89..e3b312d 100644
--- a/.github/workflows/apisix-docker-example-test.yaml
+++ b/.github/workflows/apisix-docker-example-test.yaml
@@ -9,16 +9,51 @@ on:
- 'docs/**'
- '**/*.md'
pull_request:
- paths:
- - 'example/*'
+ branches:
+ - master
+ - 'release/apisix-2.15.**'
+
+env:
+ APISIX_VERSION: "3.1.0"
jobs:
+ prepare:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Set apisix version
+ id: apisix
+ run: |
+ branch=${{ github.base_ref }}
+ apisix_version=$( (echo ${branch} | grep -Po '\d*\.\d*\.\d*') ||
echo ${APISIX_VERSION} )
+ echo "version=${apisix_version}" >> $GITHUB_OUTPUT
+
+ outputs:
+ apisix-version: ${{ steps.apisix.outputs.version }}
+
build:
runs-on: ubuntu-latest
+ needs: prepare
+ env:
+ APISIX_VERSION: ${{ needs.prepare.outputs.apisix-version }}
+
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - centos
+ - debian
+
steps:
- uses: actions/checkout@v2
+ - name: Build image
+ run: |
+ make build-on-${{ matrix.platform }}
+
- name: use docker-compose
+ env:
+ APISIX_IMAGE_TAG: ${{ format('{0}-{1}', env.APISIX_VERSION,
matrix.platform) }}
run: docker-compose -p docker-apisix -f example/docker-compose.yml up
-d
- name: Test APISIX
@@ -42,4 +77,4 @@ jobs:
if [[ $result_code -ne 200 ]];then
printf "result_code: %s\n" "$result_code"
exit 125
- fi
\ No newline at end of file
+ fi
diff --git a/.github/workflows/apisix_all_in_one_ci.yaml
b/.github/workflows/apisix_all_in_one_ci.yaml
deleted file mode 100644
index ba3960a..0000000
--- a/.github/workflows/apisix_all_in_one_ci.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-name: apisix all in one docker
-
-on:
- push:
- branches:
- - master
- pull_request:
- branches:
- - master
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
-
- - name: Build and Test
- run: |
- docker build -t apache/apisix:whole -f
./all-in-one/apisix/Dockerfile .
- docker run -v
`pwd`/all-in-one/apisix/config.yaml:/usr/local/apisix/conf/config.yaml -p
9180:9180 -p 9080:9080 -p 2379:2379 --name apisix -d apache/apisix:whole
- sleep 30
- curl http://127.0.0.1:9180/apisix/admin/schema/service -H
'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
diff --git a/example/docker-compose.yml b/example/docker-compose.yml
index fc717b8..ba23668 100644
--- a/example/docker-compose.yml
+++ b/example/docker-compose.yml
@@ -29,7 +29,7 @@ services:
apisix:
apisix:
- image: apache/apisix:3.1.0-debian
+ image: apache/apisix:${APISIX_IMAGE_TAG:-3.1.0-debian}
restart: always
volumes:
- ./apisix_log:/usr/local/apisix/logs