Skip to content

Commit 0950f6a

Browse files
authored
test: add test case for installing APISIX by packaged rpm (#58)
1 parent 24fd102 commit 0950f6a

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

.github/workflows/package-apisix.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12+
services:
13+
etcd:
14+
image: bitnami/etcd:3.4.0
15+
ports:
16+
- 2379:2379
17+
- 2380:2380
18+
env:
19+
ALLOW_NONE_AUTHENTICATION: yes
20+
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
1221

1322
steps:
1423
- uses: actions/checkout@v2
@@ -19,8 +28,29 @@ jobs:
1928
sudo gem install --no-document fpm
2029
sudo apt-get install -y rpm
2130
22-
- name: run apisix packaging test
31+
- name: packaging APISIX
2332
run: |
24-
make package type=rpm app=apisix version=2.3 checkout=2.3
25-
make package type=rpm app=apisix version=2.2 checkout=v2.2
33+
make package type=rpm app=apisix version=2.7 checkout=release/2.7
2634
make package type=rpm app=apisix version=master checkout=master
35+
36+
- name: run centos7 docker and mapping rpm into container
37+
run: |
38+
docker run -itd -v $PWD/output:/output --name centos7Instance --net="host" docker.io/centos:7 /bin/bash
39+
40+
- name: install dependencies in container
41+
run: |
42+
docker exec centos7Instance bash -c "yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo"
43+
docker exec centos7Instance bash -c "yum -y install openresty openresty-openssl111-devel"
44+
45+
- name: install APISIX by rpm in container
46+
run: |
47+
docker exec centos7Instance bash -c "yum -y localinstall /output/apisix-master-0.x86_64.rpm"
48+
docker exec centos7Instance bash -c "apisix start"
49+
50+
- name: check and ensure APISIX is installed
51+
run: |
52+
code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9080/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1')
53+
if [ ! $code -eq 200 ]; then
54+
echo "failed: failed to install Apache APISIX by rpm"
55+
exit 1
56+
fi

0 commit comments

Comments
 (0)