package apisix deb for ubuntu 24.04 #2769
This file contains hidden or 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 24.04 | |
| 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 | |
| APISIX_VERSION: master | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: install dependencies | |
| run: | | |
| sudo apt-get install -y make | |
| # install node.js and pnpm | |
| sudo n lts | |
| corepack enable pnpm | |
| - name: run apisix packaging | |
| run: | | |
| make package type=deb app=apisix version=${PACKAGE_APISIX_VERSION} checkout=${APISIX_VERSION} image_base=ubuntu image_tag=24.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.ubuntu24.04 . | |
| - name: start apisix and test | |
| run: | | |
| docker run -d --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 | |
| docker ps -a | |
| docker logs apisix-${PACKAGE_APISIX_VERSION}-deb-test | |
| 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 | |
| code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9180/ui/) | |
| if [ ! $code -eq 200 ]; then | |
| echo "failed: failed to access Apache APISIX UI" | |
| exit 1 | |
| fi | |
| - name: Publish Artifact | |
| uses: actions/[email protected] | |
| with: | |
| name: apisix_${{ env.PACKAGE_APISIX_VERSION }}-0~ubuntu24.04_amd64.deb | |
| path: output/apisix_${{ env.PACKAGE_APISIX_VERSION }}-0~ubuntu24.04_amd64.deb | |
| retention-days: 5 | |
| if-no-files-found: error |