package apisix deb for ubuntu 20.04(Focal Fossa) #1606
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: package apisix deb for ubuntu 20.04(Focal Fossa) | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- "v*" | |
paths-ignore: | |
- '*.md' | |
pull_request: | |
branches: [ master ] | |
paths-ignore: | |
- '*.md' | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
env: | |
PACKAGE_APISIX_VERSION: 0.0.0 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install dependencies | |
run: | | |
sudo apt-get install -y make | |
- name: run apisix packaging | |
run: | | |
make package type=deb app=apisix version=${PACKAGE_APISIX_VERSION} checkout=master \ | |
image_base=ubuntu image_tag=20.04 | |
- name: install apisix deb into container | |
run: | | |
docker build -t apache/apisix:${PACKAGE_APISIX_VERSION}-deb-test --build-arg APISIX_VERSION=${PACKAGE_APISIX_VERSION} -f test/apisix/Dockerfile.test.apisix.deb.ubuntu20.04 . | |
- name: start apisix and test | |
run: | | |
docker run -d --rm --name apisix-${PACKAGE_APISIX_VERSION}-deb-test -v $(pwd)/test/apisix/config.yaml:/usr/local/apisix/conf/config.yaml -p 9180:9180 -p 9080:9080 -p 9443:9443 apache/apisix:${PACKAGE_APISIX_VERSION}-deb-test | |
sleep 20 | |
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: Publish Artifact | |
uses: actions/[email protected] | |
with: | |
name: apisix_${{ env.PACKAGE_APISIX_VERSION }}-0~ubuntu20.04_amd64.deb | |
path: output/apisix_${{ env.PACKAGE_APISIX_VERSION }}-0~ubuntu20.04_amd64.deb | |
retention-days: 5 | |
if-no-files-found: error |