From c83222d023efb4241cc8e17dc647792b29f93581 Mon Sep 17 00:00:00 2001 From: Foo Bar Date: Thu, 12 Dec 2024 14:15:38 +0800 Subject: [PATCH] chage: add api7ee-runtime --- .circleci/config.yml | 269 ------------------ .github/workflows/build.yml | 42 +++ ...ckage-apisix-dashboard-deb-ubuntu20.04.yml | 69 ----- .../package-apisix-dashboard-el7-buildx.yml | 73 ----- .../package-apisix-dashboard-rpm-el7.yml | 140 --------- .../package-apisix-dashboard-rpm-el8.yml | 77 ----- .../package-apisix-deb-ubuntu20.04.yml | 67 ----- .github/workflows/package-apisix-rpm-el7.yml | 91 ------ .github/workflows/package-apisix-rpm-el8.yml | 96 ------- .github/workflows/package-apisix-rpm-ubi.yml | 89 ------ ...package-apisix-runtime-deb-ubuntu20.04.yml | 64 ----- .../package-apisix-runtime-rpm-el7.yml | 59 ---- .../package-apisix-runtime-rpm-el8.yml | 66 ----- .../package-apisix-runtime-rpm-ubi.yml | 59 ---- .github/workflows/publish-deb.yml | 121 -------- .github/workflows/publish.yml | 211 -------------- .github/workflows/push-apisix-base-image.yml | 48 ---- .../workflows/push-apisix-runtime-image.yml | 48 ---- Makefile | 66 ++--- README.md | 94 +----- VERSION | 1 + ...isix-runtime.sh => build-api7ee-runtime.sh | 20 +- build-apisix-base-debug-centos7.sh | 19 -- build-apisix-base.sh | 217 -------------- build-apisix-runtime-debug-centos7.sh | 19 -- ...time.deb => Dockerfile.api7ee-runtime.deb} | 2 +- dockerfiles/Dockerfile.apisix-base.apk | 117 -------- dockerfiles/Dockerfile.apisix-base.deb | 30 -- dockerfiles/Dockerfile.apisix-base.rpm | 33 --- dockerfiles/Dockerfile.apisix-runtime.rpm | 36 --- dockerfiles/Dockerfile.apisix.deb | 38 --- dockerfiles/Dockerfile.apisix.rpm | 47 --- dockerfiles/Dockerfile.dashboard.deb | 27 -- dockerfiles/Dockerfile.dashboard.rpm | 38 --- dockerfiles/Dockerfile.package.api7ee-runtime | 26 ++ dockerfiles/Dockerfile.package.apisix | 29 -- dockerfiles/Dockerfile.package.apisix-base | 24 -- .../Dockerfile.package.apisix-dashboard | 23 -- dockerfiles/Dockerfile.package.apisix-runtime | 26 -- ...ix-runtime.sh => package-api7ee-runtime.sh | 12 +- package-apisix-base.sh | 57 ---- package-apisix-dashboard.sh | 34 --- package-apisix.sh | 103 ------- ...-base.sh => post-install-api7ee-runtime.sh | 0 post-install-apisix-runtime.sh | 3 - utils/build-common.sh | 119 +------- utils/publish-deb.sh | 4 +- 47 files changed, 121 insertions(+), 2832 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/package-apisix-dashboard-deb-ubuntu20.04.yml delete mode 100644 .github/workflows/package-apisix-dashboard-el7-buildx.yml delete mode 100644 .github/workflows/package-apisix-dashboard-rpm-el7.yml delete mode 100644 .github/workflows/package-apisix-dashboard-rpm-el8.yml delete mode 100644 .github/workflows/package-apisix-deb-ubuntu20.04.yml delete mode 100644 .github/workflows/package-apisix-rpm-el7.yml delete mode 100644 .github/workflows/package-apisix-rpm-el8.yml delete mode 100644 .github/workflows/package-apisix-rpm-ubi.yml delete mode 100644 .github/workflows/package-apisix-runtime-deb-ubuntu20.04.yml delete mode 100644 .github/workflows/package-apisix-runtime-rpm-el7.yml delete mode 100644 .github/workflows/package-apisix-runtime-rpm-el8.yml delete mode 100644 .github/workflows/package-apisix-runtime-rpm-ubi.yml delete mode 100644 .github/workflows/publish-deb.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/push-apisix-base-image.yml delete mode 100644 .github/workflows/push-apisix-runtime-image.yml create mode 100644 VERSION rename build-apisix-runtime.sh => build-api7ee-runtime.sh (89%) delete mode 100755 build-apisix-base-debug-centos7.sh delete mode 100755 build-apisix-base.sh delete mode 100755 build-apisix-runtime-debug-centos7.sh rename dockerfiles/{Dockerfile.apisix-runtime.deb => Dockerfile.api7ee-runtime.deb} (91%) delete mode 100644 dockerfiles/Dockerfile.apisix-base.apk delete mode 100644 dockerfiles/Dockerfile.apisix-base.deb delete mode 100644 dockerfiles/Dockerfile.apisix-base.rpm delete mode 100644 dockerfiles/Dockerfile.apisix-runtime.rpm delete mode 100644 dockerfiles/Dockerfile.apisix.deb delete mode 100644 dockerfiles/Dockerfile.apisix.rpm delete mode 100644 dockerfiles/Dockerfile.dashboard.deb delete mode 100644 dockerfiles/Dockerfile.dashboard.rpm create mode 100644 dockerfiles/Dockerfile.package.api7ee-runtime delete mode 100644 dockerfiles/Dockerfile.package.apisix delete mode 100644 dockerfiles/Dockerfile.package.apisix-base delete mode 100644 dockerfiles/Dockerfile.package.apisix-dashboard delete mode 100644 dockerfiles/Dockerfile.package.apisix-runtime rename package-apisix-runtime.sh => package-api7ee-runtime.sh (75%) delete mode 100755 package-apisix-base.sh delete mode 100755 package-apisix-dashboard.sh delete mode 100755 package-apisix.sh rename post-install-apisix-base.sh => post-install-api7ee-runtime.sh (100%) delete mode 100644 post-install-apisix-runtime.sh diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index c9585c567..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,269 +0,0 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/2.0/configuration-reference -version: 2.1 -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/2.0/configuration-reference/#jobs -jobs: - build-apisix-runtime: - # Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. - # See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor - machine: - image: ubuntu-2004:202101-01 - resource_class: arm.medium - environment: - BUILD_APISIX_RUNTIME_VERSION: 0-latest - steps: - - checkout - - run: - name: install dependencies - command: | - sudo apt-get install -y make ruby ruby-dev rubygems build-essential - - run: - name: build apisix-runtime rpm - command: | - make package type=rpm app=apisix-runtime runtime_version=${BUILD_APISIX_RUNTIME_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 - - run: - name: run ubi8 docker and mapping apisix-runtime rpm into container - command: | - docker run -itd -v /home/runner/work/apisix-build-tools/apisix-build-tools/output:/output --name ubiInstance --net="host" registry.access.redhat.com/ubi8/ubi:8.6 /bin/bash - - run: - name: install dependencies in container - command: | - docker exec ubiInstance bash -c "dnf install -y yum-utils" - docker exec ubiInstance bash -c "yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo" - docker exec ubiInstance bash -c "yum -y install openresty-openssl111 openresty-pcre openresty-zlib" - - run: - name: install rpm in container - command: | - docker exec ubiInstance bash -c "ls -la /output" - docker exec ubiInstance bash -c "yum -y localinstall /output/apisix-runtime-${BUILD_APISIX_RUNTIME_VERSION}-0.ubi8.6.x86_64.rpm" - - run: - name: check and ensure apisix-runtime is installed - command: | - export APISIX_RUNTIME_VER=$(docker exec ubiInstance bash -c "openresty -V" 2>&1 | awk '/-O2 -DAPISIX_RUNTIME_VER=/{print $5}' | awk -v FS="=" '{print $2}') - - build-apisix: - # Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. - # See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor - machine: - image: ubuntu-2004:202101-01 - resource_class: arm.medium - environment: - PACKAGE_APISIX_VERSION: 0-latest - steps: - - checkout - - run: - name: install dependencies - command: | - sudo apt-get install -y make - - run: - name: package apisx - command: | - wget https://raw.githubusercontent.com/apache/apisix/master/.requirements && source .requirements - make package type=deb app=apisix version=${PACKAGE_APISIX_VERSION} runtime_version=${APISIX_RUNTIME} checkout=master image_base=ubuntu image_tag=20.04 - - run: - name: install apisix deb into container - command: | - docker build -t apache/apisix:${PACKAGE_APISIX_VERSION}-deb-test --build-arg APISIX_VERSION=${PACKAGE_APISIX_VERSION} -f test/apisix/Dockerfile.test.apisix.arm64.ubuntu20.04 . - - run: - name: start apisix and test - command: | - 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 - - build-and-push-apisix-runtime-dev-arm: - machine: - image: ubuntu-2004:202101-01 - resource_class: arm.medium - - steps: - - checkout - - run: - name: submodule - command: | - git submodule sync - git submodule update --init - - - run: - name: Build and Push Docker Image - command: | - echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - docker buildx build -t api7/apisix-runtime:dev-arm64 --push \ - --build-arg VERSION=dev --build-arg BUILD_LATEST=latest \ - -f ./dockerfiles/Dockerfile.apisix-runtime.deb . - - build-and-push-apisix-runtime-dev-x86: - machine: - image: ubuntu-2004:202101-01 - resource_class: medium - - steps: - - checkout - - run: - name: submodule - command: | - git submodule sync - git submodule update --init - - - run: - name: Build and Push Docker Image - command: | - echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - docker buildx build -t api7/apisix-runtime:dev-x86_64 --push \ - --build-arg VERSION=dev --build-arg BUILD_LATEST=latest \ - -f ./dockerfiles/Dockerfile.apisix-runtime.deb . - - upload-manifest-apisix-runtime-dev: - docker: - - image: cimg/python:3.8.2 - steps: - - checkout - - deploy: - name: "Upload apisix-runtime manifest to registry" - command: | - set -eu - export DOCKER_CLI_EXPERIMENTAL=enabled - echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - docker manifest create api7/apisix-runtime:dev \ - api7/apisix-runtime:dev-arm64 \ - api7/apisix-runtime:dev-x86_64 - docker manifest push api7/apisix-runtime:dev - - build-arm64-package: - parameters: - var_os: - type: string - var_os_release: - type: string - var_build_rpm: - type: boolean - default: false - machine: - image: ubuntu-2004:202101-01 - resource_class: arm.medium - environment: - VAR_WORKBENCH_DIR: /tmp/output - steps: - - checkout - - run: - name: Init basic publish env - command: | - mkdir -p "${VAR_WORKBENCH_DIR}" - sudo apt-get update - - - when: - condition: << parameters.var_build_rpm >> - steps: - - run: - command: | - echo 'export PACK_TYPE=rpm' >> $BASH_ENV - - unless: - condition: << parameters.var_build_rpm >> - steps: - - run: - command: | - echo 'export PACK_TYPE=deb' >> $BASH_ENV - - - when: - condition: - # enclose a pattern in ^ and $ to avoid accidental partial matches - # https://circleci.com/docs/2.0/configuration-reference#logic-statements - matches: { pattern: "^apisix/(.*)\\d+$", value: << pipeline.git.tag >> } - steps: - - run: - name: build apisix package - command: | - APISIX_TAG_VERSION=$(echo ${CIRCLE_TAG##*/}) - wget https://raw.githubusercontent.com/apache/apisix/${APISIX_TAG_VERSION}/.requirements && source .requirements - - echo "apisix version: $APISIX_TAG_VERSION" - make package type=${PACK_TYPE} app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=<< parameters.var_os >> image_tag=<< parameters.var_os_release >> - mv ./output/apisix*.${PACK_TYPE} ${VAR_WORKBENCH_DIR} - - - store_artifacts: - path: /tmp/output - - - when: - condition: - matches: { pattern: "^apisix-runtime/(.*)\\d+$", value: << pipeline.git.tag >> } - steps: - - run: - name: build apisix-runtime package - command: | - APISIX_RUNTIME_TAG_VERSION=$(echo ${CIRCLE_TAG##*/}) - echo "apisix-runtime version: $APISIX_RUNTIME_TAG_VERSION" - make package type=${PACK_TYPE} app=apisix-runtime checkout=${APISIX_RUNTIME_TAG_VERSION} version=${APISIX_RUNTIME_TAG_VERSION} image_base=<< parameters.var_os >> image_tag=<< parameters.var_os_release >> - mv ./output/apisix-runtime*.${PACK_TYPE} ${VAR_WORKBENCH_DIR} - - - store_artifacts: - path: /tmp/output - -# Invoke jobs via workflows -# See: https://circleci.com/docs/2.0/configuration-reference/#workflows -workflows: - builds: - jobs: - - build-apisix-runtime: - filters: - branches: - only: master - - build-apisix: - filters: - branches: - only: master - build-and-push-apisix-runtime-dev: - triggers: - - schedule: - cron: "0 0 * * *" - filters: - branches: - only: - - master - jobs: - - build-and-push-apisix-runtime-dev-arm - - build-and-push-apisix-runtime-dev-x86 - - upload-manifest-apisix-runtime-dev: - requires: - - build-and-push-apisix-runtime-dev-arm - - build-and-push-apisix-runtime-dev-x86 - build-mutil-platform-arm64-apckage: - jobs: - - build-arm64-package: - name: debian-bullseye - var_os: debian - var_os_release: bullseye-slim - filters: - tags: - only: /^apisix.*/ - - build-arm64-package: - name: centos 7 - var_os: centos - var_os_release: "7" - var_build_rpm: true - filters: - tags: - only: /^apisix.*/ - - build-arm64-package: - name: centos 8 - var_os: centos - var_os_release: "8" - var_build_rpm: true - filters: - tags: - only: /^apisix.*/ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..45a6aa7ab --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: Build api7ee-runtime + +on: + push: + branches: + - api7ee-runtime-test + pull_request: + branches: + - api7ee-runtime-test + +jobs: + build: + name: Build + timeout-minutes: 30 + env: + version: 0.0.0 + strategy: + fail-fast: false + matrix: + platform: + - runner: ubuntu-22.04 + arch: amd64 + build_arch: linux/amd64 + + runs-on: ${{ matrix.platform.runner }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: | + sudo apt-get install -y make ruby ruby-dev rubygems build-essential + + - name: Build api7ee-runtime deb + run: | + make package type=deb app=api7ee-runtime runtime_version=${version} image_base=debian image_tag=bullseye-slim arch=${{ matrix.platform.build_arch }} + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: api7ee-runtime_${{ env.version }}-0~debianbullseye-slim_${{ matrix.platform.arch }}.deb + path: ./output/api7ee-runtime_${{ env.version }}-0~debianbullseye-slim_${{ matrix.platform.arch }}.deb diff --git a/.github/workflows/package-apisix-dashboard-deb-ubuntu20.04.yml b/.github/workflows/package-apisix-dashboard-deb-ubuntu20.04.yml deleted file mode 100644 index 365422719..000000000 --- a/.github/workflows/package-apisix-dashboard-deb-ubuntu20.04.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: package apisix-dashboard 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: - DASHBOARD_VERSION: "3.0.1" - DASHBOARD_BRANCH: "release/3.0" - services: - etcd: - image: bitnami/etcd:3.4.0 - ports: - - 2379:2379 - - 2380:2380 - env: - ALLOW_NONE_AUTHENTICATION: yes - ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 - - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make build-essential - - - name: package apisix-dashboard - run: | - make package type=deb app=dashboard version=${DASHBOARD_VERSION} checkout=${DASHBOARD_BRANCH} image_base=ubuntu image_tag=20.04 - - - name: run ubuntu 20.04 docker and mapping deb into container - run: | - docker run -itd -v $PWD/output:/apisix-dashboard --name ubuntu20.04Instance --net="host" docker.io/ubuntu:20.04 /bin/bash - - - name: install deb package - run: | - docker exec ubuntu20.04Instance bash -c "dpkg -i /apisix-dashboard/apisix-dashboard_${DASHBOARD_VERSION}-0~ubuntu20.04_amd64.deb" - docker logs ubuntu20.04Instance - docker exec ubuntu20.04Instance bash -c "cd /usr/local/apisix/dashboard/ && nohup ./manager-api &" - - - name: run test cases - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9000) - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX Dashboard by deb" - exit 1 - fi - - - name: Publish Artifact - uses: actions/upload-artifact@v2.2.4 - with: - name: apisix-dashboard_${{ env.DASHBOARD_VERSION }}-0~ubuntu20.04_amd64.deb - path: output/apisix-dashboard_${{ env.DASHBOARD_VERSION }}-0~ubuntu20.04_amd64.deb - retention-days: 5 - if-no-files-found: error diff --git a/.github/workflows/package-apisix-dashboard-el7-buildx.yml b/.github/workflows/package-apisix-dashboard-el7-buildx.yml deleted file mode 100644 index 92dafcdba..000000000 --- a/.github/workflows/package-apisix-dashboard-el7-buildx.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: package apisix-dashabord rpm for el7 using buildx - -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: - DASHBOARD_VERSION: "3.0.1" - DASHBOARD_BRANCH: "release/3.0" - services: - etcd: - image: bitnami/etcd:3.4.0 - ports: - - 2379:2379 - - 2380:2380 - env: - ALLOW_NONE_AUTHENTICATION: yes - ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 - - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make ruby ruby-dev rubygems build-essential - sudo gem install --no-document fpm - sudo apt-get install -y rpm - - - uses: docker/setup-buildx-action@v1 - - - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-apisixdashboard-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx-apisixdashboard- - ${{ runner.os }}-buildx- - - - name: run apisix-dashboard packaging test - run: | - make package type=rpm app=dashboard version=${DASHBOARD_VERSION} checkout=${DASHBOARD_BRANCH} image_base=centos image_tag=7 buildx=True - - - name: Run centos7 docker and mapping rpm into container - run: | - docker run -itd -v $PWD/output:/apisix-dashboard --name centos7Instance --net="host" docker.io/centos:7 /bin/bash - - - name: Install rpm package - run: | - docker exec centos7Instance bash -c "yum install -y /apisix-dashboard/apisix-dashboard-${DASHBOARD_VERSION}-0.el7.x86_64.rpm" - docker logs centos7Instance - docker exec centos7Instance bash -c "cd /usr/local/apisix/dashboard/ && nohup ./manager-api &" - - - name: Run test cases - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9000) - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX Dashboard by rpm" - exit 1 - fi diff --git a/.github/workflows/package-apisix-dashboard-rpm-el7.yml b/.github/workflows/package-apisix-dashboard-rpm-el7.yml deleted file mode 100644 index 2da68772b..000000000 --- a/.github/workflows/package-apisix-dashboard-rpm-el7.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: package apisix-dashabord rpm for el7 - -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-20.04 - timeout-minutes: 60 - env: - DASHBOARD_VERSION: "3.0.1" - DASHBOARD_BRANCH: "release/3.0" - services: - etcd: - image: bitnami/etcd:3.4.0 - ports: - - 2379:2379 - - 2380:2380 - env: - ALLOW_NONE_AUTHENTICATION: yes - ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 - - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make ruby ruby-dev rubygems build-essential - sudo gem install --no-document fpm - sudo apt-get install -y rpm - - - name: run apisix-dashboard(-remote) packaging test - run: | - make package type=rpm app=dashboard version=${DASHBOARD_VERSION} checkout=${DASHBOARD_BRANCH} \ - image_base=centos image_tag=7 artifact=apisix-dashboard-remote - - - name: run apisix-dashboard(-local) packaging test - run: | - git clone -b ${DASHBOARD_BRANCH} https://github.com/apache/apisix-dashboard.git - make package type=rpm app=dashboard version=${DASHBOARD_VERSION} checkout=${DASHBOARD_BRANCH} \ - image_base=centos image_tag=7 local_code_path=./apisix-dashboard artifact=apisix-dashboard-local - - - name: Run centos7 docker and mapping rpm into container - run: | - docker run -itd -v $PWD/output:/apisix-dashboard --name centos7Instance --net="host" docker.io/centos:7 /bin/bash - - - name: Install apisix-dashboard(-remote) rpm package - run: | - docker exec centos7Instance bash -c "yum install -y /apisix-dashboard/apisix-dashboard-remote-${DASHBOARD_VERSION}-0.el7.x86_64.rpm" - docker logs centos7Instance - docker exec centos7Instance bash -c "cd /usr/local/apisix/dashboard/ && nohup ./manager-api &" - - - name: Run apisix-dashboard(-remote) test cases - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9000) - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX Dashboard by rpm" - exit 1 - fi - - - name: stop and uninstall apisix-dashboard(-remote) - run: | - docker exec centos7Instance bash -c "pkill -f manager-api" - docker exec centos7Instance bash -c "yum -y erase apisix-dashboard-remote-${DASHBOARD_VERSION}" - - - name: Install apisix-dashboard(-local) rpm package - run: | - docker exec centos7Instance bash -c "yum install -y /apisix-dashboard/apisix-dashboard-local-${DASHBOARD_VERSION}-0.el7.x86_64.rpm" - docker logs centos7Instance - docker exec centos7Instance bash -c "cd /usr/local/apisix/dashboard/ && nohup ./manager-api &" - - - name: Run apisix-dashboard(-local) test cases - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9000) - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX Dashboard by rpm" - exit 1 - fi - - - name: Rename rpm package - run: | - mv output/apisix-dashboard-local-${DASHBOARD_VERSION}-0.el7.x86_64.rpm output/apisix-dashboard-${DASHBOARD_VERSION}-0.el7.x86_64.rpm - - - name: Publish Artifact - uses: actions/upload-artifact@v2 - with: - name: apisix-dashboard-${{ env.DASHBOARD_VERSION }}-0.el7.x86_64.rpm - path: output/apisix-dashboard-${{ env.DASHBOARD_VERSION }}-0.el7.x86_64.rpm - retention-days: 5 - if-no-files-found: error - test: - runs-on: ubuntu-20.04 - needs: build - env: - DASHBOARD_VERSION: "3.0.1" - services: - etcd: - image: bitnami/etcd:3.4.0 - ports: - - 2379:2379 - - 2380:2380 - env: - ALLOW_NONE_AUTHENTICATION: yes - ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 - steps: - - name: Install podman - run: | - sudo apt update - sudo apt -y install podman - - - name: Download artifact - uses: actions/download-artifact@v2 - with: - name: apisix-dashboard-${{ env.DASHBOARD_VERSION }}-0.el7.x86_64.rpm - - - name: Start CentOS 7 container - run: | - sudo podman run -d --name test --systemd true --net host centos:7 /usr/lib/systemd/systemd - sudo podman cp apisix-dashboard-${{ env.DASHBOARD_VERSION }}-0.el7.x86_64.rpm test:/apisix-dashboard-${{ env.DASHBOARD_VERSION }}-0.el7.x86_64.rpm - sudo podman exec test rpm -ivh /apisix-dashboard-${{ env.DASHBOARD_VERSION }}-0.el7.x86_64.rpm - sudo podman exec test systemctl start apisix-dashboard - - - name: Test APISIX Dashboard status - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9000) - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX Dashboard by rpm" - exit 1 - fi diff --git a/.github/workflows/package-apisix-dashboard-rpm-el8.yml b/.github/workflows/package-apisix-dashboard-rpm-el8.yml deleted file mode 100644 index 3936a5f5b..000000000 --- a/.github/workflows/package-apisix-dashboard-rpm-el8.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: package apisix-dashabord rpm for el8 - -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: - DASHBOARD_VERSION: "3.0.1" - DASHBOARD_BRANCH: "release/3.0" - services: - etcd: - image: bitnami/etcd:3.4.0 - ports: - - 2379:2379 - - 2380:2380 - env: - ALLOW_NONE_AUTHENTICATION: yes - ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 - - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make ruby ruby-dev rubygems build-essential - sudo gem install --no-document fpm - sudo apt-get install -y rpm - - - name: run apisix-dashboard packaging test - run: | - make package type=rpm app=dashboard version=${DASHBOARD_VERSION} checkout=${DASHBOARD_BRANCH} image_base=centos image_tag=8 - - - name: Run centos8 docker and mapping rpm into container - run: | - docker run -itd -v $PWD/output:/apisix-dashboard --name centos8Instance --net="host" docker.io/centos:8 /bin/bash - - - name: Install rpm package - run: | - docker exec centos8Instance bash -c "sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*" - docker exec centos8Instance bash -c "sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*" - docker exec centos8Instance bash -c "dnf install -y centos-release-stream" - docker exec centos8Instance bash -c "dnf swap -y centos-{linux,stream}-repos" - docker exec centos8Instance bash -c "dnf distro-sync -y" - - docker exec centos8Instance bash -c "yum install -y /apisix-dashboard/apisix-dashboard-${DASHBOARD_VERSION}-0.el8.x86_64.rpm" - docker logs centos8Instance - docker exec centos8Instance bash -c "cd /usr/local/apisix/dashboard/ && nohup ./manager-api &" - - - name: Run test cases - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9000) - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX Dashboard by rpm" - exit 1 - fi - - - name: Publish Artifact - uses: actions/upload-artifact@v2.2.4 - with: - name: apisix-dashboard-${{ env.DASHBOARD_VERSION }}-0.el8.x86_64.rpm - path: output/apisix-dashboard-${{ env.DASHBOARD_VERSION }}-0.el8.x86_64.rpm - retention-days: 5 - if-no-files-found: error diff --git a/.github/workflows/package-apisix-deb-ubuntu20.04.yml b/.github/workflows/package-apisix-deb-ubuntu20.04.yml deleted file mode 100644 index 20698a126..000000000 --- a/.github/workflows/package-apisix-deb-ubuntu20.04.yml +++ /dev/null @@ -1,67 +0,0 @@ -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 - APISIX_VERSION: master - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make - - - name: run apisix packaging - run: | - wget https://raw.githubusercontent.com/apache/apisix/${APISIX_VERSION}/.requirements && source .requirements - make package type=deb app=apisix version=${PACKAGE_APISIX_VERSION} runtime_version=${APISIX_RUNTIME} checkout=${APISIX_VERSION} 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/upload-artifact@v2.2.4 - 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 diff --git a/.github/workflows/package-apisix-rpm-el7.yml b/.github/workflows/package-apisix-rpm-el7.yml deleted file mode 100644 index 8e5093aa6..000000000 --- a/.github/workflows/package-apisix-rpm-el7.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: package apisix rpm for el7 - -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: - APISIX_VERSION: master - services: - etcd: - image: bitnami/etcd:3.4.0 - ports: - - 2379:2379 - - 2380:2380 - env: - ALLOW_NONE_AUTHENTICATION: yes - ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 - - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make ruby ruby-dev rubygems build-essential - sudo gem install --no-document fpm - sudo apt-get install -y rpm - - - name: packaging APISIX(-remote) with remote code - run: | - wget https://raw.githubusercontent.com/apache/apisix/${APISIX_VERSION}/.requirements && source .requirements - make package type=rpm app=apisix version=master checkout=${APISIX_VERSION} runtime_version=${APISIX_RUNTIME} image_base=centos image_tag=7 artifact=apisix-remote - - - name: packaging APISIX(-local) with local code - run: | - wget https://raw.githubusercontent.com/apache/apisix/${APISIX_VERSION}/.requirements && source .requirements - git clone -b ${APISIX_VERSION} https://github.com/apache/apisix.git - make package type=rpm app=apisix version=master checkout=${APISIX_VERSION} runtime_version=${APISIX_RUNTIME} image_base=centos image_tag=7 local_code_path=./apisix artifact=apisix-local - - - name: run centos7 docker and mapping rpm into container - run: | - docker run -itd -v $PWD/output:/output --name centos7Instance --net="host" docker.io/centos:7 /bin/bash - - - name: enable apisix repository in container - run: | - docker exec centos7Instance bash -c "rpm --import https://repos.apiseven.com/KEYS" - docker exec centos7Instance bash -c "yum -y install https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm" - - - name: install APISIX(-remote) master by rpm in container - run: | - docker exec centos7Instance bash -c "yum -y localinstall /output/apisix-remote-master-0.el7.x86_64.rpm" - docker exec centos7Instance bash -c "apisix start" - - - name: check and ensure APISIX(-remote) master is installed - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9180/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1') - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX by rpm" - exit 1 - fi - - - name: stop and uninstall APISIX(-remote) master - run: | - docker exec centos7Instance bash -c "pkill -f nginx" - docker exec centos7Instance bash -c "yum -y erase apisix-remote-master" - - - name: install APISIX(-local) by rpm in container - run: | - docker exec centos7Instance bash -c "yum -y localinstall /output/apisix-local-master-0.el7.x86_64.rpm" - docker exec centos7Instance bash -c "apisix start" - - - name: check and ensure APISIX(-local) is installed - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9180/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1') - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX by rpm" - exit 1 - fi diff --git a/.github/workflows/package-apisix-rpm-el8.yml b/.github/workflows/package-apisix-rpm-el8.yml deleted file mode 100644 index a057071f1..000000000 --- a/.github/workflows/package-apisix-rpm-el8.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: package apisix rpm for el8 - -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: - APISIX_VERSION: master - services: - etcd: - image: bitnami/etcd:3.4.0 - ports: - - 2379:2379 - - 2380:2380 - env: - ALLOW_NONE_AUTHENTICATION: yes - ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 - - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make ruby ruby-dev rubygems build-essential - sudo gem install --no-document fpm - sudo apt-get install -y rpm - - - name: packaging APISIX(-remote) with remote code - run: | - wget https://raw.githubusercontent.com/apache/apisix/${APISIX_VERSION}/.requirements && source .requirements - make package type=rpm app=apisix version=master checkout=${APISIX_VERSION} runtime_version=${APISIX_RUNTIME} image_base=centos image_tag=8 artifact=apisix-remote - - - name: packaging APISIX(-local) with local code - run: | - wget https://raw.githubusercontent.com/apache/apisix/${APISIX_VERSION}/.requirements && source .requirements - git clone -b ${APISIX_VERSION} https://github.com/apache/apisix.git - make package type=rpm app=apisix version=master checkout=${APISIX_VERSION} runtime_version=${APISIX_RUNTIME} image_base=centos image_tag=8 local_code_path=./apisix artifact=apisix-local - - - name: run centos8 docker and mapping rpm into container - run: | - docker run -itd -v $PWD/output:/output --name centos8Instance --net="host" docker.io/centos:8 /bin/bash - docker exec centos8Instance bash -c "sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*" - docker exec centos8Instance bash -c "sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*" - docker exec centos8Instance bash -c "dnf install -y centos-release-stream" - docker exec centos8Instance bash -c "dnf swap -y centos-{linux,stream}-repos" - docker exec centos8Instance bash -c "dnf distro-sync -y" - - - name: enable apisix repository in container - run: | - docker exec centos8Instance bash -c "rpm --import https://repos.apiseven.com/KEYS" - docker exec centos8Instance bash -c "yum -y install https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm" - - - name: install APISIX(-remote) master by rpm in container - run: | - docker exec centos8Instance bash -c "yum -y localinstall /output/apisix-remote-master-0.el8.x86_64.rpm" - docker exec centos8Instance bash -c "apisix start" - - - name: check and ensure APISIX(-remote) master is installed - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9180/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1') - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX by rpm" - exit 1 - fi - - - name: stop and uninstall APISIX(-remote) master - run: | - docker exec centos8Instance bash -c "pkill -f nginx" - docker exec centos8Instance bash -c "yum -y erase apisix-remote-master" - - - name: install APISIX(-local) by rpm in container - run: | - docker exec centos8Instance bash -c "yum -y localinstall /output/apisix-local-master-0.el8.x86_64.rpm" - docker exec centos8Instance bash -c "apisix start" - - - name: check and ensure APISIX(-local) is installed - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9180/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1') - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX by rpm" - exit 1 - fi diff --git a/.github/workflows/package-apisix-rpm-ubi.yml b/.github/workflows/package-apisix-rpm-ubi.yml deleted file mode 100644 index b3b49fd69..000000000 --- a/.github/workflows/package-apisix-rpm-ubi.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: package apisix rpm for ubi - -on: - push: - branches: [ master ] - tags: - - "v*" - paths-ignore: - - '*.md' - pull_request: - branches: [ master ] - paths-ignore: - - '*.md' - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - APISIX_VERSION: master - services: - etcd: - image: bitnami/etcd:3.4.0 - ports: - - 2379:2379 - - 2380:2380 - env: - ALLOW_NONE_AUTHENTICATION: yes - ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 - - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make ruby ruby-dev rubygems build-essential - sudo gem install --no-document fpm - sudo apt-get install -y rpm - - - name: packaging APISIX(-remote) with remote code - run: | - wget https://raw.githubusercontent.com/apache/apisix/${APISIX_VERSION}/.requirements && source .requirements - make package type=rpm app=apisix version=master checkout=${APISIX_VERSION} runtime_version=${APISIX_RUNTIME} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 artifact=apisix-remote - - - name: packaging APISIX(-local) with local code - run: | - wget https://raw.githubusercontent.com/apache/apisix/${APISIX_VERSION}/.requirements && source .requirements - git clone -b ${APISIX_VERSION} https://github.com/apache/apisix.git - make package type=rpm app=apisix version=master checkout=${APISIX_VERSION} runtime_version=${APISIX_RUNTIME} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 local_code_path=./apisix artifact=apisix-local - - - name: run ubi8 docker and mapping rpm into container - run: | - docker run -itd -v $PWD/output:/output --name ubiInstance --net="host" registry.access.redhat.com/ubi8/ubi:8.6 /bin/bash - - - name: enable apisix repository in container - run: | - docker exec ubiInstance bash -c "rpm --import https://repos.apiseven.com/KEYS" - docker exec ubiInstance bash -c "yum -y install https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm" - - - name: install APISIX(-remote) master by rpm in container - run: | - docker exec ubiInstance bash -c "yum -y localinstall /output/apisix-remote-master-0.ubi8.6.x86_64.rpm" - docker exec ubiInstance bash -c "apisix start" - - - name: check and ensure APISIX(-remote) master is installed - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9180/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1') - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX by rpm" - exit 1 - fi - - - name: stop and uninstall APISIX(-remote) master - run: | - docker exec ubiInstance bash -c 'PIDS=$(pgrep -f nginx); for PID in $PIDS; do kill -TERM $PID; done' - docker exec ubiInstance bash -c "yum -y erase apisix-remote-master" - - - name: install APISIX(-local) by rpm in container - run: | - docker exec ubiInstance bash -c "yum -y localinstall /output/apisix-local-master-0.ubi8.6.x86_64.rpm" - docker exec ubiInstance bash -c "apisix start" - - - name: check and ensure APISIX(-local) is installed - run: | - code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9180/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1') - if [ ! $code -eq 200 ]; then - echo "failed: failed to install Apache APISIX by rpm" - exit 1 - fi diff --git a/.github/workflows/package-apisix-runtime-deb-ubuntu20.04.yml b/.github/workflows/package-apisix-runtime-deb-ubuntu20.04.yml deleted file mode 100644 index 02bd2f1e9..000000000 --- a/.github/workflows/package-apisix-runtime-deb-ubuntu20.04.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: package apisix-runtime 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: - BUILD_APISIX_RUNTIME_VERSION: 1.0.1 - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make ruby ruby-dev rubygems build-essential - - - name: build apisix-runtime deb - run: | - make package type=deb app=apisix-runtime runtime_version=${BUILD_APISIX_RUNTIME_VERSION} image_base=ubuntu image_tag=20.04 - - - name: run ubuntu 20.04 docker and mapping apisix-runtime deb into container - run: | - docker run -itd -v /home/runner/work/apisix-build-tools/apisix-build-tools/output:/output --name ubuntu20.04Instance --net="host" docker.io/ubuntu:20.04 /bin/bash - - - name: install dependencies in container - run: | - docker exec ubuntu20.04Instance bash -c "DEBIAN_FRONTEND=noninteractive apt-get update" - docker exec ubuntu20.04Instance bash -c "DEBIAN_FRONTEND=noninteractive apt-get install -y libreadline-dev lsb-release libssl-dev perl build-essential" - docker exec ubuntu20.04Instance bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends wget gnupg ca-certificates" - docker exec ubuntu20.04Instance bash -c "wget -O - https://openresty.org/package/pubkey.gpg | apt-key add -" - docker exec ubuntu20.04Instance bash -c 'echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/openresty.list' - docker exec ubuntu20.04Instance bash -c "DEBIAN_FRONTEND=noninteractive apt-get update" - docker exec ubuntu20.04Instance bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y install openresty-pcre openresty-zlib" - - - name: install deb in container - run: | - docker exec ubuntu20.04Instance bash -c "dpkg -i /output/apisix-runtime_${BUILD_APISIX_RUNTIME_VERSION}-0~ubuntu20.04_amd64.deb" - - - name: check and ensure apisix-runtime is installed - run: | - docker exec ubuntu20.04Instance bash -c "/usr/local/openresty/bin/etcdctl -h" || exit 1 - export APISIX_RUNTIME_VER=$(docker exec ubuntu20.04Instance bash -c "openresty -V" 2>&1 | awk '/-O2 -DAPISIX_RUNTIME_VER=/{print $5}' | awk -v FS="=" '{print $2}') - if [ "$APISIX_RUNTIME_VER" != "${BUILD_APISIX_RUNTIME_VERSION}" ]; then exit 1; fi - - - name: Publish Artifact - uses: actions/upload-artifact@v2.2.4 - with: - name: apisix-runtime_${{ env.BUILD_APISIX_RUNTIME_VERSION }}-0~ubuntu20.04_amd64.deb - path: output/apisix-runtime_${{ env.BUILD_APISIX_RUNTIME_VERSION }}-0~ubuntu20.04_amd64.deb - retention-days: 5 - if-no-files-found: error diff --git a/.github/workflows/package-apisix-runtime-rpm-el7.yml b/.github/workflows/package-apisix-runtime-rpm-el7.yml deleted file mode 100644 index e077e5a05..000000000 --- a/.github/workflows/package-apisix-runtime-rpm-el7.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: package apisix-runtime rpm for el7 - -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: - BUILD_APISIX_RUNTIME_VERSION: 1.0.1 - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make ruby ruby-dev rubygems build-essential - - - name: build apisix-runtime rpm - run: | - make package type=rpm app=apisix-runtime runtime_version=${BUILD_APISIX_RUNTIME_VERSION} image_base=centos image_tag=7 - - - name: run centos7 docker and mapping apisix-runtime rpm into container - run: | - docker run -itd -v /home/runner/work/apisix-build-tools/apisix-build-tools/output:/output --name centos7Instance --net="host" docker.io/centos:7 /bin/bash - - - name: install dependencies in container - run: | - docker exec centos7Instance bash -c "yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo" - docker exec centos7Instance bash -c "yum -y install openresty-pcre openresty-zlib" - - - name: install rpm in container - run: | - docker exec centos7Instance bash -c "yum -y localinstall /output/apisix-runtime-${BUILD_APISIX_RUNTIME_VERSION}-0.el7.x86_64.rpm" - - - name: check and ensure apisix-runtime is installed - run: | - docker exec centos7Instance bash -c "/usr/local/openresty/bin/etcdctl -h" || exit 1 - export APISIX_RUNTIME_VER=$(docker exec centos7Instance bash -c "openresty -V" 2>&1 | awk '/-O2 -DAPISIX_RUNTIME_VER=/{print $5}' | awk -v FS="=" '{print $2}') - if [ "$APISIX_RUNTIME_VER" != "${BUILD_APISIX_RUNTIME_VERSION}" ]; then exit 1; fi - - - name: Publish Artifact - uses: actions/upload-artifact@v2.2.4 - with: - name: apisix-runtime-${{ env.BUILD_APISIX_RUNTIME_VERSION }}-0.el7.x86_64.rpm - path: output/apisix-runtime-${{ env.BUILD_APISIX_RUNTIME_VERSION }}-0.el7.x86_64.rpm - retention-days: 5 - if-no-files-found: error diff --git a/.github/workflows/package-apisix-runtime-rpm-el8.yml b/.github/workflows/package-apisix-runtime-rpm-el8.yml deleted file mode 100644 index 960b08a47..000000000 --- a/.github/workflows/package-apisix-runtime-rpm-el8.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: package apisix-runtime rpm for el8 - -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: - BUILD_APISIX_RUNTIME_VERSION: 1.0.1 - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make ruby ruby-dev rubygems build-essential - - - name: build apisix-runtime rpm - run: | - make package type=rpm app=apisix-runtime runtime_version=${BUILD_APISIX_RUNTIME_VERSION} image_base=centos image_tag=8 - - - name: run centos8 docker and mapping apisix-runtime rpm into container - run: | - docker run -itd -v /home/runner/work/apisix-build-tools/apisix-build-tools/output:/output --name centos8Instance --net="host" docker.io/centos:8 /bin/bash - - - name: install dependencies in container - run: | - docker exec centos8Instance bash -c "sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*" - docker exec centos8Instance bash -c "sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*" - docker exec centos8Instance bash -c "dnf install -y centos-release-stream" - docker exec centos8Instance bash -c "dnf swap -y centos-{linux,stream}-repos" - docker exec centos8Instance bash -c "dnf distro-sync -y" - - docker exec centos8Instance bash -c "dnf install -y yum-utils" - docker exec centos8Instance bash -c "yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo" - docker exec centos8Instance bash -c "yum -y install openresty-pcre openresty-zlib" - - - name: install rpm in container - run: | - docker exec centos8Instance bash -c "yum -y localinstall /output/apisix-runtime-${BUILD_APISIX_RUNTIME_VERSION}-0.el8.x86_64.rpm" - - - name: check and ensure apisix-runtime is installed - run: | - docker exec centos8Instance bash -c "/usr/local/openresty/bin/etcdctl -h" || exit 1 - export APISIX_RUNTIME_VER=$(docker exec centos8Instance bash -c "openresty -V" 2>&1 | awk '/-O2 -DAPISIX_RUNTIME_VER=/{print $5}' | awk -v FS="=" '{print $2}') - if [ "$APISIX_RUNTIME_VER" != "${BUILD_APISIX_RUNTIME_VERSION}" ]; then exit 1; fi - - - name: Publish Artifact - uses: actions/upload-artifact@v2.2.4 - with: - name: apisix-runtime-${{ env.BUILD_APISIX_RUNTIME_VERSION }}-0.el8.x86_64.rpm - path: output/apisix-runtime-${{ env.BUILD_APISIX_RUNTIME_VERSION }}-0.el8.x86_64.rpm - retention-days: 5 - if-no-files-found: error diff --git a/.github/workflows/package-apisix-runtime-rpm-ubi.yml b/.github/workflows/package-apisix-runtime-rpm-ubi.yml deleted file mode 100644 index 18280930d..000000000 --- a/.github/workflows/package-apisix-runtime-rpm-ubi.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: package apisix-runtime rpm for ubi - -on: - push: - branches: [ master ] - tags: - - "v*" - paths-ignore: - - '*.md' - pull_request: - branches: [ master ] - paths-ignore: - - '*.md' - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - BUILD_APISIX_RUNTIME_VERSION: 1.0.1 - steps: - - uses: actions/checkout@v2 - - - name: install dependencies - run: | - sudo apt-get install -y make ruby ruby-dev rubygems build-essential - - - name: build apisix-runtime rpm - run: | - make package type=rpm app=apisix-runtime runtime_version=${BUILD_APISIX_RUNTIME_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 - - - name: run ubi8 docker and mapping apisix-runtime rpm into container - run: | - docker run -itd -v /home/runner/work/apisix-build-tools/apisix-build-tools/output:/output --name ubiInstance --net="host" registry.access.redhat.com/ubi8/ubi:8.6 /bin/bash - - - name: install dependencies in container - run: | - docker exec ubiInstance bash -c "dnf install -y yum-utils" - docker exec ubiInstance bash -c "yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo" - docker exec ubiInstance bash -c "yum -y install openresty-pcre openresty-zlib" - - - name: install rpm in container - run: | - docker exec ubiInstance bash -c "ls -la /output" - docker exec ubiInstance bash -c "yum -y localinstall /output/apisix-runtime-${BUILD_APISIX_RUNTIME_VERSION}-0.ubi8.6.x86_64.rpm" - - - name: check and ensure apisix-runtime is installed - run: | - docker exec ubiInstance bash -c "/usr/local/openresty/bin/etcdctl -h" || exit 1 - export APISIX_RUNTIME_VER=$(docker exec ubiInstance bash -c "openresty -V" 2>&1 | awk '/-O2 -DAPISIX_RUNTIME_VER=/{print $5}' | awk -v FS="=" '{print $2}') - if [ "$APISIX_RUNTIME_VER" != "${BUILD_APISIX_RUNTIME_VERSION}" ]; then exit 1; fi - - - name: Publish Artifact - uses: actions/upload-artifact@v2.2.4 - with: - name: apisix-runtime-${{ env.BUILD_APISIX_RUNTIME_VERSION }}-0.ubi8.6.x86_64.rpm - path: output/apisix-runtime-${{ env.BUILD_APISIX_RUNTIME_VERSION }}-0.ubi8.6.x86_64.rpm - retention-days: 5 - if-no-files-found: error diff --git a/.github/workflows/publish-deb.yml b/.github/workflows/publish-deb.yml deleted file mode 100644 index f68e354a9..000000000 --- a/.github/workflows/publish-deb.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: Build and Publish DEB Package - -on: - create: - -jobs: - publish_apisix: - name: Build and Publish deb Package - runs-on: ubuntu-20.04 - timeout-minutes: 60 - env: - VAR_DEB_WORKBENCH_DIR: /tmp/output - VAR_COS_BUCKET_REPO: ${{ secrets.VAR_COS_BUCKET_REPO }} - VAR_COS_BUCKET_CI: ${{ secrets.VAR_COS_BUCKET_CI }} - VAR_OS: debian - VAR_CODENAME: bullseye - VAR_OS_RELEASE: bullseye-slim - - steps: - - name: Check out code - uses: actions/checkout@v2.3.5 - with: - submodules: recursive - - - name: Init basic publish env - run: | - sudo apt-get update - mkdir -p "${VAR_DEB_WORKBENCH_DIR}" - - - name: Extract Tags version - if: ${{ startsWith(github.ref, 'refs/tags/') }} - shell: bash - run: | - echo "TAG_VERSION=${GITHUB_REF##*/}" >> "$GITHUB_ENV" - - - name: Extract Tags Type - if: ${{ startsWith(github.ref, 'refs/tags/') }} - shell: bash - run: | - type=$(echo ${GITHUB_REF} | awk -F '/' '{print $3}') - echo "TAG_TYPE=${type}" >> "$GITHUB_ENV" - - - name: Check Tags Type - if: ${{ env.TAG_TYPE != 'apisix' && env.TAG_TYPE != 'apisix-base' }} - run: | - echo "##[error]Tag type is not correct, or not support, please check it." - exit 1 - - - name: Build apisix-base deb Package - if: ${{ env.TAG_TYPE == 'apisix-base' }} - run: | - make package type=deb app=${TAG_TYPE} checkout=${TAG_VERSION} version=${TAG_VERSION} image_base=${VAR_OS} image_tag=${VAR_OS_RELEASE} openresty=apisix-base - mv ./output/${TAG_TYPE}_${TAG_VERSION}-0~${VAR_OS}${VAR_OS_RELEASE}_amd64.deb ${VAR_DEB_WORKBENCH_DIR} - - - name: Build apisix deb Package - if: ${{ env.TAG_TYPE == 'apisix' }} - run: | - wget https://raw.githubusercontent.com/apache/apisix/${TAG_VERSION}/.requirements && source .requirements - - make package type=deb app=${TAG_TYPE} checkout=${TAG_VERSION} version=${TAG_VERSION} image_base=${VAR_OS} image_tag=${VAR_OS_RELEASE} openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} - mv ./output/${TAG_TYPE}_${TAG_VERSION}-0~${VAR_OS}${VAR_OS_RELEASE}_amd64.deb ${VAR_DEB_WORKBENCH_DIR} - - - name: Upload apisix/apisix-base Artifact - uses: actions/upload-artifact@v2.2.3 - with: - name: "${{ env.TAG_TYPE }}_${{ env.TAG_VERSION }}-0~${{ env.VAR_OS }}${{ env.VAR_OS_RELEASE }}_amd64.deb" - path: "${{ env.VAR_DEB_WORKBENCH_DIR }}/${{ env.TAG_TYPE}}_${{ env.TAG_VERSION }}-0~${{ env.VAR_OS }}${{ env.VAR_OS_RELEASE }}_amd64.deb" - - - name: Build apisix-runtime deb Package - if: ${{ env.TAG_TYPE == 'apisix-runtime' }} - run: | - echo build ${TAG_TYPE} deb package - echo version ${TAG_VERSION} - - make package type=deb app=${TAG_TYPE} checkout=${TAG_VERSION} version=${TAG_VERSION} image_base=${VAR_OS} image_tag=${VAR_OS_RELEASE} openresty=apisix-runtime - mv ./output/${TAG_TYPE}_${TAG_VERSION}-0~${VAR_OS}${VAR_OS_RELEASE}_amd64.deb ${VAR_DEB_WORKBENCH_DIR} - - - name: Upload apisix/apisix-runtime Artifact - uses: actions/upload-artifact@v2.2.3 - with: - name: "${{ env.TAG_TYPE }}_${{ env.TAG_VERSION }}-0~${{ env.VAR_OS }}${{ env.VAR_OS_RELEASE }}_amd64.deb" - path: "${{ env.VAR_DEB_WORKBENCH_DIR }}/${{ env.TAG_TYPE}}_${{ env.TAG_VERSION }}-0~${{ env.VAR_OS }}${{ env.VAR_OS_RELEASE }}_amd64.deb" - - - name: DEB repo deps init - env: - TENCENT_COS_SECRETID: ${{ secrets.TENCENT_COS_SECRETID }} - TENCENT_COS_SECRETKEY: ${{ secrets.TENCENT_COS_SECRETKEY }} - run: | - sudo pip install coscmd - sudo -E ./utils/publish-deb.sh init_cos_utils - - - name: DEB repo init for debian - run: | - sudo -E ./utils/publish-deb.sh repo_clone - - - name: DEB repo package update - env: - DEB_GPG_MAIL: ${{ secrets.DEB_GPG_MAIL }} - GPG_NAME: ${{ secrets.GPG_NAME }} - GPG_MAIL: ${{ secrets.GPG_MAIL }} - run: | - echo "${{ secrets.DEB_GPG_PRIV_KEY }}" >> /tmp/deb-gpg-publish.private - echo "${{ secrets.DEB_GPG_PASSPHRASE }}" >> /tmp/deb-gpg-publish.passphrase - sudo -E ./utils/publish-deb.sh init_freight_utils - sudo -E ./utils/publish-deb.sh init_gpg - - - name: DEB repo backup for debian - run: | - sudo -E ./utils/publish-deb.sh dists_backup - - - name: DEB repo refresh for debian - run: | - sudo -E ./utils/publish-deb.sh repo_rebuild - sudo -E ./utils/publish-deb.sh repo_ci_upload - - - name: DEB repo publish for debian - env: - UPLOAD_TARGET_FILE: "${{ env.TAG_TYPE }}_${{ env.TAG_VERSION }}-0_amd64.deb" - run: | - sudo -E ./utils/publish-deb.sh repo_upload - sudo -E ./utils/publish-deb.sh repo_publish diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 61cb77de8..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,211 +0,0 @@ -name: Build and Publish RPM Package - -on: - create: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }} - cancel-in-progress: true - -jobs: - publish_apisix: - name: Build and Publish RPM Package - runs-on: ubuntu-22.04 - timeout-minutes: 180 - env: - VAR_COS_BUCKET_CI: ${{ secrets.VAR_COS_BUCKET_CI }} - VAR_COS_BUCKET_REPO: ${{ secrets.VAR_COS_BUCKET_REPO }} - VAR_COS_ENDPOINT: ${{ secrets.VAR_COS_ENDPOINT }} - VAR_RPM_WORKBENCH_DIR: /tmp/output - - steps: - - name: Check out code - uses: actions/checkout@v2.3.5 - with: - submodules: recursive - - - name: Init basic publish env - run: | - # install publish env deps - sudo apt-get update - sudo apt install -y createrepo-c - mkdir -p "${VAR_RPM_WORKBENCH_DIR}" - # init env var - TAG_DATE=$(date +%Y%m%d) - echo "TAG_DATE=${TAG_DATE}" >> "$GITHUB_ENV" - - - name: Extract Tags version - if: ${{ startsWith(github.ref, 'refs/tags/') }} - shell: bash - run: | - echo "TAG_VERSION=${GITHUB_REF##*/}" >> "$GITHUB_ENV" - - - name: Extract Tags Type - if: ${{ startsWith(github.ref, 'refs/tags/') }} - shell: bash - run: | - type=$(echo ${GITHUB_REF} | awk -F '/' '{print $3}') - echo "TAG_TYPE=${type}" >> "$GITHUB_ENV" - - - name: Check Tags Type - if: ${{ env.TAG_TYPE != 'apisix' && env.TAG_TYPE != 'apisix-base' && env.TAG_TYPE != 'dashboard' }} - run: | - echo "##[error]Tag type is not correct, or not support, please check it." - exit 1 - - - name: Build apisix RPM Package - if: ${{ env.TAG_TYPE == 'apisix' }} - env: - APISIX_TAG_VERSION: ${{ env.TAG_VERSION }} - run: | - wget https://raw.githubusercontent.com/apache/apisix/${APISIX_TAG_VERSION}/.requirements - source .requirements - - # build apisix - make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=centos image_tag=7 - make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=centos image_tag=8 - make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 - mv ./output/apisix-${APISIX_TAG_VERSION}-0.{el7,el8,ubi8.6}.x86_64.rpm ${VAR_RPM_WORKBENCH_DIR} - echo "TARGET_APP=apisix" >> "$GITHUB_ENV" - - - name: Build apisix-base RPM Package - if: ${{ env.TAG_TYPE == 'apisix-base' }} - env: - APISIX_BASE_TAG_VERSION: ${{ env.TAG_VERSION }} - run: | - # build apisix-base - echo ${{ env.TAG_TYPE }} ${{ env.TAG_VERSION }} - make package type=rpm app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=centos image_tag=7 - make package type=rpm app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=centos image_tag=8 - make package type=rpm app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 - mv ./output/apisix-base-${APISIX_BASE_TAG_VERSION}-0.{el7,el8,ubi8.6}.x86_64.rpm ${VAR_RPM_WORKBENCH_DIR} - echo "TARGET_APP=apisix-base" >> "$GITHUB_ENV" - - - name: Build apisix-runtime RPM Package - if: ${{ env.TAG_TYPE == 'apisix-runtime' }} - env: - APISIX_RUNTIME_TAG_VERSION: ${{ env.TAG_VERSION }} - run: | - # build apisix-runtime - echo ${{ env.TAG_TYPE }} ${{ env.TAG_VERSION }} - make package type=rpm app=apisix-runtime checkout=${APISIX_RUNTIME_TAG_VERSION} version=${APISIX_RUNTIME_TAG_VERSION} image_base=centos image_tag=7 - make package type=rpm app=apisix-runtime checkout=${APISIX_RUNTIME_TAG_VERSION} version=${APISIX_RUNTIME_TAG_VERSION} image_base=centos image_tag=8 - make package type=rpm app=apisix-runtime checkout=${APISIX_RUNTIME_TAG_VERSION} version=${APISIX_RUNTIME_TAG_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 - mv ./output/apisix-runtime-${APISIX_RUNTIME_TAG_VERSION}-0.{el7,el8,ubi8.6}.x86_64.rpm ${VAR_RPM_WORKBENCH_DIR} - echo "TARGET_APP=apisix-runtime" >> "$GITHUB_ENV" - - - name: Build apisix-dashboard RPM Package - if: ${{ env.TAG_TYPE == 'dashboard' }} - env: - APISIX_DASHBOARD_TAG_VERSION: ${{ env.TAG_VERSION }} - run: | - # build apisix dashboard - make package type=rpm app=dashboard checkout=${APISIX_DASHBOARD_TAG_VERSION} version=${APISIX_DASHBOARD_TAG_VERSION} image_base=centos image_tag=7 - make package type=rpm app=dashboard checkout=${APISIX_DASHBOARD_TAG_VERSION} version=${APISIX_DASHBOARD_TAG_VERSION} image_base=centos image_tag=8 - mv ./output/apisix-dashboard-${APISIX_DASHBOARD_TAG_VERSION}-0.el{7,8}.x86_64.rpm ${VAR_RPM_WORKBENCH_DIR} - echo "TARGET_APP=apisix-dashboard" >> "$GITHUB_ENV" - - - - name: Ensure the upload dir - run: | - ls -al "${VAR_RPM_WORKBENCH_DIR}" - - - name: Upload apisix Artifact for Redhat - if: ${{ env.TAG_TYPE == 'apisix' }} - uses: actions/upload-artifact@v2.2.3 - env: - PACKAGE_NAME: apisix-${{ env.TAG_VERSION }}-0.ubi8.6.x86_64.rpm - with: - name: "${PACKAGE_NAME}" - path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}" - - - name: Upload apisix Artifact for Centos - if: ${{ env.TAG_TYPE == 'apisix' }} - uses: actions/upload-artifact@v2.2.3 - env: - PACKAGE_NAME: apisix-${{ env.TAG_VERSION }}-0.el7.x86_64.rpm - with: - name: "${PACKAGE_NAME}" - path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}" - - - name: Upload apisix-base Artifact for Redhat - if: ${{ env.TAG_TYPE == 'apisix-base' }} - uses: actions/upload-artifact@v2.2.3 - env: - PACKAGE_NAME: apisix-base-${{ env.TAG_VERSION }}-0.ubi8.6.x86_64.rpm - with: - name: "${PACKAGE_NAME}" - path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}" - - - name: Upload apisix-base Artifact for Centos - if: ${{ env.TAG_TYPE == 'apisix-base' }} - uses: actions/upload-artifact@v2.2.3 - env: - PACKAGE_NAME: apisix-base-${{ env.TAG_VERSION }}-0.el7.x86_64.rpm - with: - name: "${PACKAGE_NAME}" - path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}" - - - name: Upload apisix-runtime Artifact for Redhat - if: ${{ env.TAG_TYPE == 'apisix-runtime' }} - uses: actions/upload-artifact@v2.2.3 - env: - PACKAGE_NAME: apisix-runtime-${{ env.TAG_VERSION }}-0.ubi8.6.x86_64.rpm - with: - name: "${PACKAGE_NAME}" - path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}" - - - name: Upload apisix-runtime Artifact for Centos - if: ${{ env.TAG_TYPE == 'apisix-runtime' }} - uses: actions/upload-artifact@v2.2.3 - env: - PACKAGE_NAME: apisix-runtime-${{ env.TAG_VERSION }}-0.el7.x86_64.rpm - with: - name: "${PACKAGE_NAME}" - path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}" - - - name: Upload apisix-dashboard Artifact - if: ${{ env.TAG_TYPE == 'dashboard' }} - uses: actions/upload-artifact@v2.2.3 - env: - PACKAGE_NAME: apisix-dashboard-${{ env.TAG_VERSION }}-0.el7.x86_64.rpm - with: - name: "${PACKAGE_NAME}" - path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}" - - - name: RPM repo deps init - env: - TENCENT_COS_SECRETID: ${{ secrets.TENCENT_COS_SECRETID }} - TENCENT_COS_SECRETKEY: ${{ secrets.TENCENT_COS_SECRETKEY }} - run: | - sudo pip install coscmd - sudo -E ./utils/publish-rpm.sh init_cos_utils - - - name: RPM repo init for centos and redhat - run: | - sudo -E ./utils/publish-rpm.sh repo_init - sudo -E ./utils/publish-rpm.sh repo_clone - - - name: RPM repo package update - env: - GPG_NAME: ${{ secrets.GPG_NAME }} - GPG_MAIL: ${{ secrets.GPG_MAIL }} - run: | - echo "${{ secrets.RPM_GPG_PRIV_KEY }}" >> /tmp/rpm-gpg-publish.private - echo "${{ secrets.RPM_GPG_PASSPHRASE }}" >> /tmp/rpm-gpg-publish.passphrase - echo "${{ secrets.RPM_GPG_PUB_KEY }}" >> /tmp/rpm-gpg-publish.public - sudo -E ./utils/publish-rpm.sh rpm_gpg_sign - sudo -E ./utils/publish-rpm.sh repo_package_sync - - - name: RPM repo backup for centos and redhat - run: | - sudo -E ./utils/publish-rpm.sh repo_backup - - - name: RPM repo refresh for centos and redhat - run: | - sudo -E ./utils/publish-rpm.sh repo_repodata_rebuild - sudo -E ./utils/publish-rpm.sh repo_upload - - - name: RPM repo publish for centos and redhat - run: | - sudo -E ./utils/publish-rpm.sh repo_publish diff --git a/.github/workflows/push-apisix-base-image.yml b/.github/workflows/push-apisix-base-image.yml deleted file mode 100644 index 98ef85c83..000000000 --- a/.github/workflows/push-apisix-base-image.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build and Push image - -on: - create - -jobs: - publish_image: - name: Build and Push apisix-base image - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2.3.5 - with: - submodules: recursive - - - name: Extract Tags name - if: ${{ startsWith(github.ref, 'refs/tags/') }} - id: tag_env - shell: bash - run: | - echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})" - - - name: Extract Tags Type - if: ${{ startsWith(github.ref, 'refs/tags/') }} - id: tag_type - shell: bash - run: | - echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/tags/})" - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub - if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-base/') }} - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and Push Docker Image - if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-base/') }} - run: | - docker buildx build -t api7/apisix-base:${{ steps.tag_env.outputs.version }} --push \ - --build-arg VERSION=${{ steps.tag_env.outputs.version }} --platform linux/amd64,linux/arm64 \ - -f ./dockerfiles/Dockerfile.apisix-base.apk . diff --git a/.github/workflows/push-apisix-runtime-image.yml b/.github/workflows/push-apisix-runtime-image.yml deleted file mode 100644 index 0f9b3a15c..000000000 --- a/.github/workflows/push-apisix-runtime-image.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build and Push apisix-runtime image - -on: - create - -jobs: - publish_image: - name: Build and Push apisix-runtime image - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2.3.5 - with: - submodules: recursive - - - name: Extract Tags name - if: ${{ startsWith(github.ref, 'refs/tags/') }} - id: tag_env - shell: bash - run: | - echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})" - - - name: Extract Tags Type - if: ${{ startsWith(github.ref, 'refs/tags/') }} - id: tag_type - shell: bash - run: | - echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/tags/})" - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub - if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-runtime/') }} - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and Push Docker Image - if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-runtime/') }} - run: | - docker buildx build -t api7/apisix-runtime:${{ steps.tag_env.outputs.version }} --push \ - --build-arg VERSION=${{ steps.tag_env.outputs.version }} --platform linux/amd64,linux/arm64 \ - -f ./dockerfiles/Dockerfile.apisix-runtime.apk . diff --git a/Makefile b/Makefile index 08d14a0ab..41e095e77 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ image_base="centos" image_tag="7" iteration=0 local_code_path=0 -openresty="apisix-runtime" +openresty="api7ee-runtime" artifact="0" runtime_version="0" apisix_repo="https://github.com/apache/apisix" @@ -76,7 +76,7 @@ define build endef endif -### function for building apisix-runtime +### function for building api7ee-runtime ### $(1) is name ### $(2) is dockerfile filename ### $(3) is package type @@ -241,36 +241,36 @@ package-dashboard-rpm: package-dashboard-deb: $(call package,apisix-dashboard,deb) -### build apisix-runtime: -.PHONY: build-apisix-runtime-rpm -build-apisix-runtime-rpm: +### build api7ee-runtime: +.PHONY: build-api7ee-runtime-rpm +build-api7ee-runtime-rpm: ifeq ($(app),apisix) - git clone -b apisix-runtime/$(runtime_version) $(apisix_runtime_repo) ./apisix-runtime - $(call build_runtime,apisix-runtime,apisix-runtime,rpm,"./apisix-runtime") - rm -fr ./apisix-runtime + git clone -b api7ee-runtime/$(runtime_version) $(apisix_runtime_repo) ./api7ee-runtime + $(call build_runtime,api7ee-runtime,api7ee-runtime,rpm,"./api7ee-runtime") + rm -fr ./api7ee-runtime else - $(call build_runtime,apisix-runtime,apisix-runtime,rpm,"./") + $(call build_runtime,api7ee-runtime,api7ee-runtime,rpm,"./") endif -.PHONY: build-apisix-runtime-deb -build-apisix-runtime-deb: +.PHONY: build-api7ee-runtime-deb +build-api7ee-runtime-deb: ifeq ($(app),apisix) - git clone -b apisix-runtime/$(runtime_version) $(apisix_runtime_repo) ./apisix-runtime - $(call build_runtime,apisix-runtime,apisix-runtime,deb,"./apisix-runtime") - rm -fr ./apisix-runtime + git clone -b api7ee-runtime/$(runtime_version) $(apisix_runtime_repo) ./api7ee-runtime + $(call build_runtime,api7ee-runtime,api7ee-runtime,deb,"./api7ee-runtime") + rm -fr ./api7ee-runtime else - $(call build_runtime,apisix-runtime,apisix-runtime,deb,"./") + $(call build_runtime,api7ee-runtime,api7ee-runtime,deb,"./") endif -### build rpm for apisix-runtime: -.PHONY: package-apisix-runtime-rpm -package-apisix-runtime-rpm: - $(call package_runtime,apisix-runtime,rpm) +### build rpm for api7ee-runtime: +.PHONY: package-api7ee-runtime-rpm +package-api7ee-runtime-rpm: + $(call package_runtime,api7ee-runtime,rpm) -### build deb for apisix-runtime: -.PHONY: package-apisix-runtime-deb -package-apisix-runtime-deb: - $(call package_runtime,apisix-runtime,deb) +### build deb for api7ee-runtime: +.PHONY: package-api7ee-runtime-deb +package-api7ee-runtime-deb: + $(call package_runtime,api7ee-runtime,deb) ### build apisix-base: .PHONY: build-apisix-base-rpm @@ -310,8 +310,8 @@ build-fpm: -t api7/fpm - < ./dockerfiles/Dockerfile.fpm endif -ifeq ($(filter $(app),apisix dashboard apisix-base apisix-runtime),) -$(info the app's value have to be apisix, dashboard, apisix-base and apisix-runtime!) +ifeq ($(filter $(app),apisix dashboard apisix-base api7ee-runtime),) +$(info the app's value have to be apisix, dashboard, apisix-base and api7ee-runtime!) else ifeq ($(filter $(type),rpm deb apk),) $(info the type's value have to be rpm, deb or apk!) @@ -326,15 +326,15 @@ package: build-fpm package: build-apisix-base-deb package: package-apisix-base-deb -else ifeq ($(app)_$(type),apisix-runtime_deb) +else ifeq ($(app)_$(type),api7ee-runtime_deb) package: build-fpm -package: build-apisix-runtime-deb -package: package-apisix-runtime-deb +package: build-api7ee-runtime-deb +package: package-api7ee-runtime-deb -else ifeq ($(app)_$(type),apisix-runtime_rpm) +else ifeq ($(app)_$(type),api7ee-runtime_rpm) package: build-fpm -package: build-apisix-runtime-rpm -package: package-apisix-runtime-rpm +package: build-api7ee-runtime-rpm +package: package-api7ee-runtime-rpm else ifeq ($(app)_$(type),apisix-base_apk) package: build-apisix-base-apk @@ -344,13 +344,13 @@ $(info you have to input a checkout value!) else ifeq ($(app)_$(type),apisix_rpm) package: build-fpm -package: build-apisix-runtime-rpm +package: build-api7ee-runtime-rpm package: build-apisix-rpm package: package-apisix-rpm else ifeq ($(app)_$(type),apisix_deb) package: build-fpm -package: build-apisix-runtime-deb +package: build-api7ee-runtime-deb package: build-apisix-deb package: package-apisix-deb diff --git a/README.md b/README.md index 6fdb82354..f7ba80dc7 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,12 @@ ## Parameters | Parameter | Required | Description | Example | |-----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------| -| type | True | it can be `deb` or `rpm` or `apk` | type=rpm | -| app | True | it can be `apisix`, `dashboard`, `apisix-base` or `apisix-runtime` | app=apisix | +| type | True | it can be `deb` | type=rpm | +| app | True | it can be `api7ee-runtime` | app=api7ee-runtime | | checkout | True | the code branch or tag of the app which you want to package | checkout=2.1 or checkout=v2.1 | | version | True | the version of the package | version=10.10 | | local_code_path | False | the path of local code diretory of apisix or dashboard, which depends on the app parameter | local_code_path=/home/vagrant/apisix | -| openresty | False | the openresty type that apisix depends on, its value can be `openresty`, `apisix-base` or `apisix-runtime`, the default is `openresty` | openresty=apisix-base | +| openresty | False | the openresty type that apisix depends on, its value can be `api7ee-runtime`, the default is `openresty` | openresty=api7ee-runtime | | artifact | False | the final name of the generated artifact, if not specified, this will be the same as `app` | artifact=apisix | | image_base | False | the environment for packaging, if type is `rpm` the default image_base is `centos`, if type is `deb` the default image_base is `ubuntu` | image_base=centos | | image_tag | False | the environment for packaging, it's value can be `16.04\|18.04\|20.04\|6\|7\|8`, if type is `rpm` the default image_tag is `7`, if type is `deb` the default image_tag is `20.04` | image_tag=7 | @@ -21,97 +21,15 @@ ## Example -### build APISIX - -Packaging a Centos 7 package of Apache APISIX -```sh -make package type=rpm app=apisix version=2.2 checkout=2.2 image_base=centos image_tag=7 -ls output/ -apisix-2.2-0.el7.x86_64.rpm -``` -or just leave `image_base` and `image_tag` as the default values. -``` -make package type=rpm app=apisix version=2.2 checkout=2.2 -ls output/ -apisix-2.2-0.el7.x86_64.rpm -``` - -Packaging a Centos 8 package of Apache APISIX -```sh -make package type=rpm app=apisix version=2.2 checkout=2.2 image_base=centos image_tag=8 -ls output/ -apisix-2.2-0.el8.x86_64.rpm -``` - -Packaging an Ubuntu 20.04 package of Apache APISIX -```sh -make package type=deb app=apisix version=2.2 checkout=2.2 -ls output/ -apisix_2.2-0~ubuntu20.04_amd64.deb -``` - -### build dashboard - -Packaging a Centos 7 package of Apache APISIX Dashboard -```sh -make package type=rpm app=dashboard version=2.4 checkout=v2.4 image_base=centos image_tag=7 -ls output/ -apisix-dashboard-2.4-0.el7.x86_64.rpm -``` - -Packaging an Ubuntu 20.04 package of Apache APISIX Dashboard -```sh -make package type=deb app=apisix version=2.2 checkout=2.2 -ls output/ -apisix-dashboard_2.2-0~ubuntu20.04_amd64.deb -``` - -### build apisix-base - -Packaging a Centos 7 package of APISIX's OpenResty distribution -```sh -make package type=rpm app=apisix-base version=1.0.0 image_base=centos image_tag=7 -ls output/ -apisix-base-1.0.0-0.el7.x86_64.rpm -``` - -Packaging an Ubuntu 20.04 package of Apache APISIX's OpenResty distribution -```sh -make package type=deb app=apisix-base version=1.0.0 -ls output/ -apisix-base_1.0.0-0~ubuntu20.04_amd64.deb -``` - -Packaging an Alpine docker image of Apache APISIX's OpenResty distribution -```sh -make package version=1.19.3.2.1 image_base=alpine image_tag=3.12 app=apisix-base type=apk -docker images -REPOSITORY TAG -apache/apisix-base-apk 1.19.3.2.1 -``` - -### build APISIX-runtime +### build api7ee-runtime Packaging a Centos 7 package of APISIX's OpenResty distribution -```sh -make package type=rpm app=apisix-runtime version=1.0.0 image_base=centos image_tag=7 -ls output/ -apisix-runtime-1.0.0-0.el7.x86_64.rpm -``` Packaging an Ubuntu 20.04 package of Apache APISIX's OpenResty distribution ```sh -make package type=deb app=apisix-runtime version=1.0.0 +make package type=deb app=api7ee-runtime version=1.0.0 ls output/ -apisix-runtime_1.0.0-0~ubuntu20.04_amd64.deb -``` - -Packaging an Alpine docker image of Apache APISIX's OpenResty distribution -```sh -make package type=apk app=apisix-runtime version=1.0.0 image_base=golang image_tag=1.19-alpine -docker images -REPOSITORY TAG IMAGE ID CREATED SIZE -apache/apisix-runtime-apk 1.0.0 cd456bf03d1c 9 seconds ago 504MB +api7ee-runtime_1.0.0-0~ubuntu20.04_amd64.deb ``` ## Details diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..8428158dc --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.1.2 \ No newline at end of file diff --git a/build-apisix-runtime.sh b/build-api7ee-runtime.sh similarity index 89% rename from build-apisix-runtime.sh rename to build-api7ee-runtime.sh index 917d287df..26642e623 100755 --- a/build-apisix-runtime.sh +++ b/build-api7ee-runtime.sh @@ -20,14 +20,13 @@ ld_opt=${ld_opt:-"-L$zlib_prefix/lib -L$pcre_prefix/lib -L$OPENSSL_PREFIX/lib -W # dependencies for building openresty -OPENSSL_VERSION=${OPENSSL_VERSION:-"3.2.0"} +OPENSSL_VERSION=${OPENSSL_VERSION:-"3.2.3"} OPENRESTY_VERSION="1.21.4.4" ngx_multi_upstream_module_ver="1.1.1" mod_dubbo_ver="1.0.2" apisix_nginx_module_ver="1.16.3" wasm_nginx_module_ver="0.6.5" lua_var_nginx_module_ver="v0.5.3" -grpc_client_nginx_module_ver="v0.4.4" lua_resty_events_ver="0.2.0" @@ -128,13 +127,6 @@ else lua-var-nginx-module-${lua_var_nginx_module_ver} fi -if [ "$repo" == grpc-client-nginx-module ]; then - cp -r "$prev_workdir" ./grpc-client-nginx-module-${grpc_client_nginx_module_ver} -else - git clone --depth=1 -b $grpc_client_nginx_module_ver \ - https://github.com/api7/grpc-client-nginx-module \ - grpc-client-nginx-module-${grpc_client_nginx_module_ver} -fi cd ngx_multi_upstream_module-${ngx_multi_upstream_module_ver} || exit 1 ./patch.sh ../openresty-${OPENRESTY_VERSION} @@ -151,9 +143,6 @@ cd .. luajit_xcflags=${luajit_xcflags:="-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT"} no_pool_patch=${no_pool_patch:-} -# TODO: remove old NGX_HTTP_GRPC_CLI_ENGINE_PATH once we have released a new -# version of grpc-client-nginx-module -grpc_engine_path="-DNGX_GRPC_CLI_ENGINE_PATH=$OR_PREFIX/libgrpc_engine.so -DNGX_HTTP_GRPC_CLI_ENGINE_PATH=$OR_PREFIX/libgrpc_engine.so" cd openresty-${OPENRESTY_VERSION} || exit 1 @@ -171,7 +160,7 @@ fi ./configure --prefix="$OR_PREFIX" \ - --with-cc-opt="-DAPISIX_RUNTIME_VER=$runtime_version $grpc_engine_path $cc_opt" \ + --with-cc-opt="-DAPI7EE_RUNTIME_VER=$runtime_version $cc_opt" \ --with-ld-opt="-Wl,-rpath,$OR_PREFIX/wasmtime-c-api/lib $ld_opt" \ $debug_args \ --add-module=../mod_dubbo-${mod_dubbo_ver} \ @@ -181,7 +170,6 @@ fi --add-module=../apisix-nginx-module-${apisix_nginx_module_ver}/src/meta \ --add-module=../wasm-nginx-module-${wasm_nginx_module_ver} \ --add-module=../lua-var-nginx-module-${lua_var_nginx_module_ver} \ - --add-module=../grpc-client-nginx-module-${grpc_client_nginx_module_ver} \ --add-module=../lua-resty-events-${lua_resty_events_ver} \ --with-poll_module \ --with-pcre-jit \ @@ -232,10 +220,6 @@ cd wasm-nginx-module-${wasm_nginx_module_ver} || exit 1 sudo OPENRESTY_PREFIX="$OR_PREFIX" make install cd .. -cd grpc-client-nginx-module-${grpc_client_nginx_module_ver} || exit 1 -sudo OPENRESTY_PREFIX="$OR_PREFIX" make install -cd .. - # package etcdctl ETCD_ARCH="amd64" ETCD_VERSION=${ETCD_VERSION:-'3.5.4'} diff --git a/build-apisix-base-debug-centos7.sh b/build-apisix-base-debug-centos7.sh deleted file mode 100755 index 26f2289bd..000000000 --- a/build-apisix-base-debug-centos7.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -set -x - -yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo -yum -y install gcc gcc-c++ patch wget git make sudo -yum -y install openresty-openssl111-debug-devel openresty-pcre-devel openresty-zlib-devel - -export openssl_prefix=/usr/local/openresty-debug/openssl111 -export zlib_prefix=/usr/local/openresty/zlib -export pcre_prefix=/usr/local/openresty/pcre - -export cc_opt="-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC -I${zlib_prefix}/include -I${pcre_prefix}/include -I${openssl_prefix}/include -O0" -export ld_opt="-L${zlib_prefix}/lib -L${pcre_prefix}/lib -L${openssl_prefix}/lib -Wl,-rpath,${zlib_prefix}/lib:${pcre_prefix}/lib:${openssl_prefix}/lib" -export luajit_xcflags="-DLUAJIT_ASSERT -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT -O0" -export OR_PREFIX=/usr/local/openresty-debug -export debug_args=--with-debug - -./build-apisix-base.sh diff --git a/build-apisix-base.sh b/build-apisix-base.sh deleted file mode 100755 index eb9243456..000000000 --- a/build-apisix-base.sh +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -set -x - -version=${version:-0.0.0} - -OPENRESTY_VERSION=${OPENRESTY_VERSION:-1.21.4.2} -if [ "$OPENRESTY_VERSION" == "source" ] || [ "$OPENRESTY_VERSION" == "default" ]; then - OPENRESTY_VERSION="1.21.4.2" -fi - -if ([ $# -gt 0 ] && [ "$1" == "latest" ]) || [ "$version" == "latest" ]; then - ngx_multi_upstream_module_ver="master" - mod_dubbo_ver="master" - apisix_nginx_module_ver="main" - wasm_nginx_module_ver="main" - lua_var_nginx_module_ver="master" - grpc_client_nginx_module_ver="main" - lua_resty_events_ver="main" - debug_args="--with-debug" - OR_PREFIX=${OR_PREFIX:="/usr/local/openresty-debug"} -else - ngx_multi_upstream_module_ver="1.1.1" - mod_dubbo_ver="1.0.2" - apisix_nginx_module_ver="1.15.0" - wasm_nginx_module_ver="0.6.5" - lua_var_nginx_module_ver="v0.5.3" - grpc_client_nginx_module_ver="v0.4.4" - lua_resty_events_ver="0.2.0" - debug_args=${debug_args:-} - OR_PREFIX=${OR_PREFIX:="/usr/local/openresty"} -fi - -prev_workdir="$PWD" -repo=$(basename "$prev_workdir") -workdir=$(mktemp -d) -cd "$workdir" || exit 1 - -wget --no-check-certificate https://openresty.org/download/openresty-${OPENRESTY_VERSION}.tar.gz -tar -zxvpf openresty-${OPENRESTY_VERSION}.tar.gz > /dev/null - -if [ "$repo" == ngx_multi_upstream_module ]; then - cp -r "$prev_workdir" ./ngx_multi_upstream_module-${ngx_multi_upstream_module_ver} -else - git clone --depth=1 -b $ngx_multi_upstream_module_ver \ - https://github.com/api7/ngx_multi_upstream_module.git \ - ngx_multi_upstream_module-${ngx_multi_upstream_module_ver} -fi - -if [ "$repo" == mod_dubbo ]; then - cp -r "$prev_workdir" ./mod_dubbo-${mod_dubbo_ver} -else - git clone --depth=1 -b $mod_dubbo_ver \ - https://github.com/api7/mod_dubbo.git \ - mod_dubbo-${mod_dubbo_ver} -fi - -if [ "$repo" == apisix-nginx-module ]; then - cp -r "$prev_workdir" ./apisix-nginx-module-${apisix_nginx_module_ver} -else - git clone --depth=1 -b $apisix_nginx_module_ver \ - https://github.com/api7/apisix-nginx-module.git \ - apisix-nginx-module-${apisix_nginx_module_ver} -fi - -if [ "$repo" == wasm-nginx-module ]; then - cp -r "$prev_workdir" ./wasm-nginx-module-${wasm_nginx_module_ver} -else - git clone --depth=1 -b $wasm_nginx_module_ver \ - https://github.com/api7/wasm-nginx-module.git \ - wasm-nginx-module-${wasm_nginx_module_ver} -fi - -if [ "$repo" == lua-var-nginx-module ]; then - cp -r "$prev_workdir" ./lua-var-nginx-module-${lua_var_nginx_module_ver} -else - git clone --depth=1 -b $lua_var_nginx_module_ver \ - https://github.com/api7/lua-var-nginx-module \ - lua-var-nginx-module-${lua_var_nginx_module_ver} -fi - -if [ "$repo" == grpc-client-nginx-module ]; then - cp -r "$prev_workdir" ./grpc-client-nginx-module-${grpc_client_nginx_module_ver} -else - git clone --depth=1 -b $grpc_client_nginx_module_ver \ - https://github.com/api7/grpc-client-nginx-module \ - grpc-client-nginx-module-${grpc_client_nginx_module_ver} -fi - -if [ "$repo" == lua-resty-events ]; then - cp -r "$prev_workdir" ./lua-resty-events-${lua_resty_events_ver} -else - git clone --depth=1 -b $lua_resty_events_ver \ - https://github.com/Kong/lua-resty-events.git \ - lua-resty-events-${lua_resty_events_ver} -fi - -cd ngx_multi_upstream_module-${ngx_multi_upstream_module_ver} || exit 1 -./patch.sh ../openresty-${OPENRESTY_VERSION} -cd .. - -cd apisix-nginx-module-${apisix_nginx_module_ver}/patch || exit 1 -./patch.sh ../../openresty-${OPENRESTY_VERSION} -cd ../.. - -cd wasm-nginx-module-${wasm_nginx_module_ver} || exit 1 -./install-wasmtime.sh -cd .. - -cc_opt=${cc_opt:-} -ld_opt=${ld_opt:-} -luajit_xcflags=${luajit_xcflags:="-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT"} -no_pool_patch=${no_pool_patch:-} -# TODO: remove old NGX_HTTP_GRPC_CLI_ENGINE_PATH once we have released a new -# version of grpc-client-nginx-module -grpc_engine_path="-DNGX_GRPC_CLI_ENGINE_PATH=$OR_PREFIX/libgrpc_engine.so -DNGX_HTTP_GRPC_CLI_ENGINE_PATH=$OR_PREFIX/libgrpc_engine.so" - -cd openresty-${OPENRESTY_VERSION} || exit 1 - -if [[ "$OPENRESTY_VERSION" == 1.21.4.1 ]] || [[ "$OPENRESTY_VERSION" == 1.19.* ]]; then -# FIXME: remove this once 1.21.4.2 is released -rm -rf bundle/LuaJIT-2.1-20220411 -lj_ver=2.1-20230119 -wget "https://github.com/openresty/luajit2/archive/v$lj_ver.tar.gz" -O "LuaJIT-$lj_ver.tar.gz" -tar -xzf LuaJIT-$lj_ver.tar.gz -mv luajit2-* bundle/LuaJIT-2.1-20220411 -fi - -or_limit_ver=0.08 -if [ ! -d "bundle/lua-resty-limit-traffic-$or_limit_ver" ]; then - echo "ERROR: the official repository of lua-resty-limit-traffic has been updated, please sync to API7's repository." >&2 - exit 1 -else - rm -rf bundle/lua-resty-limit-traffic-$or_limit_ver - limit_ver=1.0.0 - wget "https://github.com/api7/lua-resty-limit-traffic/archive/refs/tags/v$limit_ver.tar.gz" -O "lua-resty-limit-traffic-$limit_ver.tar.gz" - tar -xzf lua-resty-limit-traffic-$limit_ver.tar.gz - mv lua-resty-limit-traffic-$limit_ver bundle/lua-resty-limit-traffic-$or_limit_ver -fi - -./configure --prefix="$OR_PREFIX" \ - --with-cc-opt="-DAPISIX_BASE_VER=$version $grpc_engine_path $cc_opt" \ - --with-ld-opt="-Wl,-rpath,$OR_PREFIX/wasmtime-c-api/lib $ld_opt" \ - $debug_args \ - --add-module=../mod_dubbo-${mod_dubbo_ver} \ - --add-module=../ngx_multi_upstream_module-${ngx_multi_upstream_module_ver} \ - --add-module=../apisix-nginx-module-${apisix_nginx_module_ver} \ - --add-module=../apisix-nginx-module-${apisix_nginx_module_ver}/src/stream \ - --add-module=../apisix-nginx-module-${apisix_nginx_module_ver}/src/meta \ - --add-module=../wasm-nginx-module-${wasm_nginx_module_ver} \ - --add-module=../lua-var-nginx-module-${lua_var_nginx_module_ver} \ - --add-module=../grpc-client-nginx-module-${grpc_client_nginx_module_ver} \ - --add-module=../lua-resty-events-${lua_resty_events_ver} \ - --with-poll_module \ - --with-pcre-jit \ - --without-http_rds_json_module \ - --without-http_rds_csv_module \ - --without-lua_rds_parser \ - --with-stream \ - --with-stream_ssl_module \ - --with-stream_ssl_preread_module \ - --with-http_v2_module \ - --without-mail_pop3_module \ - --without-mail_imap_module \ - --without-mail_smtp_module \ - --with-http_stub_status_module \ - --with-http_realip_module \ - --with-http_addition_module \ - --with-http_auth_request_module \ - --with-http_secure_link_module \ - --with-http_random_index_module \ - --with-http_gzip_static_module \ - --with-http_sub_module \ - --with-http_dav_module \ - --with-http_flv_module \ - --with-http_mp4_module \ - --with-http_gunzip_module \ - --with-threads \ - --with-compat \ - --with-luajit-xcflags="$luajit_xcflags" \ - $no_pool_patch \ - -j`nproc` - -make -j`nproc` -sudo make install -cd .. - -cd apisix-nginx-module-${apisix_nginx_module_ver} || exit 1 -sudo OPENRESTY_PREFIX="$OR_PREFIX" make install -cd .. - -cd wasm-nginx-module-${wasm_nginx_module_ver} || exit 1 -sudo OPENRESTY_PREFIX="$OR_PREFIX" make install -cd .. - -cd grpc-client-nginx-module-${grpc_client_nginx_module_ver} || exit 1 -sudo OPENRESTY_PREFIX="$OR_PREFIX" make install -cd .. - -cd lua-resty-events-${lua_resty_events_ver} || exit 1 -sudo OPENRESTY_PREFIX="$OR_PREFIX" make install -cd .. - -# package etcdctl -ETCD_ARCH="amd64" -ETCD_VERSION=${ETCD_VERSION:-'3.5.4'} -ARCH=${ARCH:-$(uname -m | tr '[:upper:]' '[:lower:]')} - -if [[ $ARCH == "arm64" ]] || [[ $ARCH == "aarch64" ]]; then - ETCD_ARCH="arm64" -fi - -wget -q https://github.com/etcd-io/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-${ETCD_ARCH}.tar.gz -tar xf etcd-v${ETCD_VERSION}-linux-${ETCD_ARCH}.tar.gz -# ship etcdctl under the same bin dir of openresty so we can package it easily -sudo cp etcd-v${ETCD_VERSION}-linux-${ETCD_ARCH}/etcdctl "$OR_PREFIX"/bin/ -rm -rf etcd-v${ETCD_VERSION}-linux-${ETCD_ARCH} diff --git a/build-apisix-runtime-debug-centos7.sh b/build-apisix-runtime-debug-centos7.sh deleted file mode 100755 index 3dbb053fa..000000000 --- a/build-apisix-runtime-debug-centos7.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -set -x - -yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo -yum -y install gcc gcc-c++ patch wget git make sudo -yum -y install openresty-pcre-devel openresty-zlib-devel - -export openssl_prefix=/usr/local/openresty/openssl3 -export zlib_prefix=/usr/local/openresty/zlib -export pcre_prefix=/usr/local/openresty/pcre - -export cc_opt="-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC -I${zlib_prefix}/include -I${pcre_prefix}/include -I${openssl_prefix}/include -O0" -export ld_opt="-L${zlib_prefix}/lib -L${pcre_prefix}/lib -L${openssl_prefix}/lib -Wl,-rpath,${zlib_prefix}/lib:${pcre_prefix}/lib:${openssl_prefix}/lib" -export luajit_xcflags="-DLUAJIT_ASSERT -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT -O0" -export OR_PREFIX=/usr/local/openresty -export debug_args=--with-debug - -./build-apisix-runtime.sh latest diff --git a/dockerfiles/Dockerfile.apisix-runtime.deb b/dockerfiles/Dockerfile.api7ee-runtime.deb similarity index 91% rename from dockerfiles/Dockerfile.apisix-runtime.deb rename to dockerfiles/Dockerfile.api7ee-runtime.deb index cda3dfe89..dba6b603d 100644 --- a/dockerfiles/Dockerfile.apisix-runtime.deb +++ b/dockerfiles/Dockerfile.api7ee-runtime.deb @@ -21,7 +21,7 @@ ENV build_latest=${BUILD_LATEST:-} COPY ${CODE_PATH} ./ RUN mv ./utils/build-common.sh ./utils/determine-dist.sh ./ \ - && ./build-common.sh build_apisix_runtime_deb ${build_latest} \ + && ./build-common.sh build_api7ee_runtime_deb ${build_latest} \ # determine dist and write it into /tmp/dist file && ./determine-dist.sh diff --git a/dockerfiles/Dockerfile.apisix-base.apk b/dockerfiles/Dockerfile.apisix-base.apk deleted file mode 100644 index cc853170b..000000000 --- a/dockerfiles/Dockerfile.apisix-base.apk +++ /dev/null @@ -1,117 +0,0 @@ -ARG IMAGE_BASE="alpine" -ARG IMAGE_TAG="3.15" - -FROM ${IMAGE_BASE}:${IMAGE_TAG} as build - -COPY ./utils/build-common.sh \ - ./utils/install-common.sh \ - build-apisix-base.sh \ - ./utils/determine-dist.sh \ - /tmp/ - - -ARG RESTY_OPENSSL_VERSION="1.1.1g" -ARG RESTY_OPENSSL_PATCH_VERSION="1.1.1f" -ARG RESTY_OPENSSL_URL_BASE="https://www.openssl.org/source" -ARG RESTY_PCRE_VERSION="8.44" -ARG RESTY_J="1" -ARG RESTY_EVAL_PRE_CONFIGURE="" -ARG VERSION - -LABEL resty_image_base="${RESTY_IMAGE_BASE}" -LABEL resty_image_tag="${IMAGE_TAG}" -LABEL resty_openssl_version="${RESTY_OPENSSL_VERSION}" -LABEL resty_openssl_patch_version="${RESTY_OPENSSL_PATCH_VERSION}" -LABEL resty_openssl_url_base="${RESTY_OPENSSL_URL_BASE}" -LABEL resty_pcre_version="${RESTY_PCRE_VERSION}" -LABEL resty_eval_pre_configure="${RESTY_EVAL_PRE_CONFIGURE}" - - -ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin - -RUN apk add --no-cache \ - build-base \ - coreutils \ - curl \ - gd \ - gd-dev \ - geoip \ - geoip-dev \ - libxslt \ - libxslt-dev \ - linux-headers \ - make \ - perl-dev \ - readline-dev \ - zlib \ - zlib-dev \ - unzip \ - git \ - sudo \ - bash \ - libstdc++ - -# install latest Rust to build wasmtime -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - -RUN cd /tmp \ - && if [ -n "${RESTY_EVAL_PRE_CONFIGURE}" ]; then eval $(echo ${RESTY_EVAL_PRE_CONFIGURE}); fi \ - && cd /tmp \ - && curl -fSL "${RESTY_OPENSSL_URL_BASE}/openssl-${RESTY_OPENSSL_VERSION}.tar.gz" -o openssl-${RESTY_OPENSSL_VERSION}.tar.gz \ - && tar xzf openssl-${RESTY_OPENSSL_VERSION}.tar.gz \ - && cd openssl-${RESTY_OPENSSL_VERSION} \ - && echo 'patching OpenSSL 1.1.1 for OpenResty' \ - && curl -s https://raw.githubusercontent.com/openresty/openresty/master/patches/openssl-${RESTY_OPENSSL_PATCH_VERSION}-sess_set_get_cb_yield.patch | patch -p1 \ - && ./config \ - no-threads shared zlib -g \ - enable-ssl3 enable-ssl3-method \ - --prefix=/usr/local/openresty/openssl111 \ - --libdir=lib \ - -Wl,-rpath,/usr/local/openresty/openssl111/lib \ - && make -j${RESTY_J} \ - && make -j${RESTY_J} install_sw - -RUN cd /tmp \ - && curl -fSL https://downloads.sourceforge.net/project/pcre/pcre/${RESTY_PCRE_VERSION}/pcre-${RESTY_PCRE_VERSION}.tar.gz -o pcre-${RESTY_PCRE_VERSION}.tar.gz \ - && tar xzf pcre-${RESTY_PCRE_VERSION}.tar.gz \ - && cd /tmp/pcre-${RESTY_PCRE_VERSION} \ - && ./configure \ - --prefix=/usr/local/openresty/pcre \ - --disable-cpp \ - --enable-jit \ - --enable-utf \ - --enable-unicode-properties \ - && make -j${RESTY_J} \ - && make -j${RESTY_J} install - -ENV version=${VERSION} -RUN cd /tmp \ - && curl --version \ - && source /root/.cargo/env \ - && ./build-common.sh build_apisix_base_apk \ - && rm /usr/local/openresty/wasmtime-c-api/lib/libwasmtime.a \ - && rm /usr/local/openresty/wasmtime-c-api/lib/libwasmtime.d \ - && /usr/local/openresty/bin/openresty -V - - -FROM ${IMAGE_BASE}:${IMAGE_TAG} as prod - -COPY --from=build /usr/local/openresty /usr/local/openresty - -RUN apk add --no-cache \ - gd \ - geoip \ - libxslt \ - zlib \ - libstdc++ \ - && apk add --no-cache --virtual .build-deps \ - curl \ - make \ - sudo \ - && curl https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh -sL | sh - \ - && apk del .build-deps - - -ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin - -CMD /bin/sh diff --git a/dockerfiles/Dockerfile.apisix-base.deb b/dockerfiles/Dockerfile.apisix-base.deb deleted file mode 100644 index f28e9ff22..000000000 --- a/dockerfiles/Dockerfile.apisix-base.deb +++ /dev/null @@ -1,30 +0,0 @@ -ARG IMAGE_BASE="debian" -ARG IMAGE_TAG="bullseye-slim" - -FROM ${IMAGE_BASE}:${IMAGE_TAG} as build - -COPY ./utils/build-common.sh /tmp/build-common.sh -COPY build-apisix-base.sh /tmp/build-apisix-base.sh -COPY ./utils/determine-dist.sh /tmp/determine-dist.sh - -WORKDIR /tmp - -ARG VERSION -ARG IMAGE_BASE -ARG IMAGE_TAG -ARG BUILD_LATEST - -ENV IMAGE_BASE=${IMAGE_BASE} -ENV IMAGE_TAG=${IMAGE_TAG} -ENV version=${VERSION} -ENV build_latest=${BUILD_LATEST:-} - -RUN ./build-common.sh build_apisix_base_deb ${build_latest} \ - # determine dist and write it into /tmp/dist file - && /tmp/determine-dist.sh - -FROM ${IMAGE_BASE}:${IMAGE_TAG} as prod - -COPY --from=build /usr/local /usr/local -COPY --from=build /tmp/dist /tmp/dist -COPY --from=build /tmp/codename /tmp/codename diff --git a/dockerfiles/Dockerfile.apisix-base.rpm b/dockerfiles/Dockerfile.apisix-base.rpm deleted file mode 100644 index 6981c018a..000000000 --- a/dockerfiles/Dockerfile.apisix-base.rpm +++ /dev/null @@ -1,33 +0,0 @@ -ARG IMAGE_BASE="centos" -ARG IMAGE_TAG="7" - -FROM ${IMAGE_BASE}:${IMAGE_TAG} - -# Note: The duplication around the rpm series dockerfile here -# is used for reuse the container layer cache -RUN if [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then \ - sed -re "s/^#?\s*(mirrorlist)/#\1/g" \ - -e "s|^#?\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" \ - -i /etc/yum.repos.d/CentOS-Linux-*; \ - dnf install -y centos-release-stream; \ - dnf swap -y centos-{linux,stream}-repos; \ - dnf distro-sync -y; \ - fi - -COPY ./utils/build-common.sh /tmp/build-common.sh -COPY build-apisix-base.sh /tmp/build-apisix-base.sh -COPY ./utils/determine-dist.sh /tmp/determine-dist.sh - -WORKDIR /tmp - -ARG VERSION -ARG IMAGE_BASE -ARG IMAGE_TAG - -ENV IMAGE_BASE=${IMAGE_BASE} -ENV IMAGE_TAG=${IMAGE_TAG} -ENV version=${VERSION} - -RUN ./build-common.sh build_apisix_base_rpm \ - # determine dist and write it into /tmp/dist file - && /tmp/determine-dist.sh diff --git a/dockerfiles/Dockerfile.apisix-runtime.rpm b/dockerfiles/Dockerfile.apisix-runtime.rpm deleted file mode 100644 index ee116271a..000000000 --- a/dockerfiles/Dockerfile.apisix-runtime.rpm +++ /dev/null @@ -1,36 +0,0 @@ -ARG IMAGE_BASE="centos" -ARG IMAGE_TAG="7" - -FROM ${IMAGE_BASE}:${IMAGE_TAG} - -# Note: The duplication around the rpm series dockerfile here -# is used for reuse the container layer cache -RUN if [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then \ - sed -re "s/^#?\s*(mirrorlist)/#\1/g" \ - -e "s|^#?\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" \ - -i /etc/yum.repos.d/CentOS-Linux-*; \ - dnf install -y centos-release-stream; \ - dnf swap -y centos-{linux,stream}-repos; \ - dnf distro-sync -y; \ - fi - - -WORKDIR /tmp - -ARG VERSION -ARG RUNTIME_VERSION -ARG IMAGE_BASE -ARG IMAGE_TAG -ARG CODE_PATH - -ENV IMAGE_BASE=${IMAGE_BASE} -ENV IMAGE_TAG=${IMAGE_TAG} -ENV version=${VERSION} -ENV runtime_version=${RUNTIME_VERSION} - -COPY ${CODE_PATH} ./ - -RUN mv ./utils/build-common.sh ./utils/determine-dist.sh ./ \ - && ./build-common.sh build_apisix_runtime_rpm \ - # determine dist and write it into /tmp/dist file - && ./determine-dist.sh diff --git a/dockerfiles/Dockerfile.apisix.deb b/dockerfiles/Dockerfile.apisix.deb deleted file mode 100644 index ac774f204..000000000 --- a/dockerfiles/Dockerfile.apisix.deb +++ /dev/null @@ -1,38 +0,0 @@ -ARG IMAGE_BASE="ubuntu" -ARG IMAGE_TAG="20.04" -ARG PACKAGE_TYPE -ARG RUNTIME_VERSION - -FROM apache/apisix-runtime-${PACKAGE_TYPE}:${RUNTIME_VERSION} AS APISIX-RUNTIME -FROM ${IMAGE_BASE}:${IMAGE_TAG} - - - -COPY ./utils/install-common.sh /install-common.sh -COPY ./utils/determine-dist.sh /determine-dist.sh -COPY --from=APISIX-RUNTIME /usr/local/openresty /usr/local/openresty - -ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin - -ARG iteration="0" -ARG apisix_repo="https://github.com/apache/apisix" -ARG checkout_v -ARG IMAGE_BASE -ARG IMAGE_TAG -ARG CODE_PATH - -# install dependencies -RUN /install-common.sh install_apisix_dependencies_deb - -ENV checkout_v=${checkout_v} -ENV iteration=${iteration} -ENV apisix_repo=${apisix_repo} -ENV IMAGE_BASE=${IMAGE_BASE} -ENV IMAGE_TAG=${IMAGE_TAG} - -COPY ${CODE_PATH} /apisix - -# install apisix -RUN /install-common.sh install_apisix \ - # determine dist and write it into /tmp/dist file - && /determine-dist.sh diff --git a/dockerfiles/Dockerfile.apisix.rpm b/dockerfiles/Dockerfile.apisix.rpm deleted file mode 100644 index 509f2a76c..000000000 --- a/dockerfiles/Dockerfile.apisix.rpm +++ /dev/null @@ -1,47 +0,0 @@ -ARG IMAGE_BASE="centos" -ARG IMAGE_TAG="7" -ARG PACKAGE_TYPE -ARG RUNTIME_VERSION - -FROM apache/apisix-runtime-${PACKAGE_TYPE}:${RUNTIME_VERSION} AS APISIX-RUNTIME -FROM ${IMAGE_BASE}:${IMAGE_TAG} - -# Note: The duplication around the rpm series dockerfile here -# is used for reuse the container layer cache -RUN if [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then \ - sed -re "s/^#?\s*(mirrorlist)/#\1/g" \ - -e "s|^#?\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" \ - -i /etc/yum.repos.d/CentOS-Linux-*; \ - dnf install -y centos-release-stream; \ - dnf swap -y centos-{linux,stream}-repos; \ - dnf distro-sync -y; \ - fi - -COPY ./utils/install-common.sh /install-common.sh -COPY ./utils/determine-dist.sh /determine-dist.sh -COPY --from=APISIX-RUNTIME /usr/local/openresty /usr/local/openresty - -ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin - -ARG iteration="0" -ARG apisix_repo="https://github.com/apache/apisix" -ARG checkout_v -ARG IMAGE_BASE -ARG IMAGE_TAG -ARG CODE_PATH - -# install dependencies -RUN /install-common.sh install_apisix_dependencies_rpm - -ENV checkout_v=${checkout_v} -ENV iteration=${iteration} -ENV apisix_repo=${apisix_repo} -ENV IMAGE_BASE=${IMAGE_BASE} -ENV IMAGE_TAG=${IMAGE_TAG} - -COPY ${CODE_PATH} /apisix - -# install apisix -RUN /install-common.sh install_apisix \ - # determine dist and write it into /tmp/dist file - && /determine-dist.sh diff --git a/dockerfiles/Dockerfile.dashboard.deb b/dockerfiles/Dockerfile.dashboard.deb deleted file mode 100644 index ffdbd3d22..000000000 --- a/dockerfiles/Dockerfile.dashboard.deb +++ /dev/null @@ -1,27 +0,0 @@ -ARG IMAGE_BASE="ubuntu" -ARG IMAGE_TAG="20.04" - -FROM ${IMAGE_BASE}:${IMAGE_TAG} - -COPY ./utils/install-common.sh /install-common.sh -COPY ./utils/determine-dist.sh /determine-dist.sh - -# install dependencies -RUN /install-common.sh install_dashboard_dependencies_deb - -ARG checkout_v="v2.3" -ARG iteration="0" -ARG goproxy="" -ARG IMAGE_BASE -ARG IMAGE_TAG -ARG CODE_PATH - -ENV IMAGE_BASE=${IMAGE_BASE} -ENV IMAGE_TAG=${IMAGE_TAG} - -COPY ${CODE_PATH} /apisix-dashboard - -# install APISIX dashboard -RUN /install-common.sh install_dashboard \ - # determine dist and write it into /tmp/dist file - && /determine-dist.sh diff --git a/dockerfiles/Dockerfile.dashboard.rpm b/dockerfiles/Dockerfile.dashboard.rpm deleted file mode 100644 index c82add2a2..000000000 --- a/dockerfiles/Dockerfile.dashboard.rpm +++ /dev/null @@ -1,38 +0,0 @@ -ARG IMAGE_BASE="centos" -ARG IMAGE_TAG="7" - -FROM ${IMAGE_BASE}:${IMAGE_TAG} - -# Note: The duplication around the rpm series dockerfile here -# is used for reuse the container layer cache -RUN if [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then \ - sed -re "s/^#?\s*(mirrorlist)/#\1/g" \ - -e "s|^#?\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" \ - -i /etc/yum.repos.d/CentOS-Linux-*; \ - dnf install -y centos-release-stream; \ - dnf swap -y centos-{linux,stream}-repos; \ - dnf distro-sync -y; \ - fi - -COPY ./utils/install-common.sh /install-common.sh -COPY ./utils/determine-dist.sh /determine-dist.sh - -# install dependencies -RUN /install-common.sh install_dashboard_dependencies_rpm - -ARG checkout_v="v2.3" -ARG iteration="0" -ARG goproxy="" -ARG IMAGE_BASE -ARG IMAGE_TAG -ARG CODE_PATH - -ENV IMAGE_BASE=${IMAGE_BASE} -ENV IMAGE_TAG=${IMAGE_TAG} - -COPY ${CODE_PATH} /apisix-dashboard - -# install APISIX dashboard -RUN /install-common.sh install_dashboard \ - # determine dist and write it into /tmp/dist file - && /determine-dist.sh diff --git a/dockerfiles/Dockerfile.package.api7ee-runtime b/dockerfiles/Dockerfile.package.api7ee-runtime new file mode 100644 index 000000000..c2ba7e898 --- /dev/null +++ b/dockerfiles/Dockerfile.package.api7ee-runtime @@ -0,0 +1,26 @@ +ARG PACKAGE_TYPE +ARG RUNTIME_VERSION + +FROM apache/api7ee-runtime-${PACKAGE_TYPE}:${RUNTIME_VERSION} AS api7ee-runtime +FROM api7/fpm + +ARG ITERATION +ARG PACKAGE_VERSION +ARG RUNTIME_VERSION +ARG PACKAGE_TYPE +ARG ARTIFACT + +ENV ITERATION=${ITERATION} +ENV PACKAGE_VERSION=${PACKAGE_VERSION} +ENV RUNTIME_VERSION=${RUNTIME_VERSION} +ENV PACKAGE_TYPE=${PACKAGE_TYPE} +ENV ARTIFACT=${ARTIFACT} + +COPY --from=api7ee-runtime /usr/local/openresty /tmp/build/output/openresty +COPY --from=api7ee-runtime /tmp/dist /tmp/dist +COPY --from=api7ee-runtime /tmp/codename /tmp/codename +COPY package-api7ee-runtime.sh /package-api7ee-runtime.sh +COPY post-install-api7ee-runtime.sh /post-install-api7ee-runtime.sh +COPY usr /usr + +RUN /package-api7ee-runtime.sh diff --git a/dockerfiles/Dockerfile.package.apisix b/dockerfiles/Dockerfile.package.apisix deleted file mode 100644 index 43e06237e..000000000 --- a/dockerfiles/Dockerfile.package.apisix +++ /dev/null @@ -1,29 +0,0 @@ -ARG VERSION -ARG PACKAGE_TYPE - -FROM apache/apisix-${PACKAGE_TYPE}:${VERSION} AS APISIX -FROM api7/fpm - -ARG ITERATION -ARG PACKAGE_VERSION -ARG PACKAGE_TYPE -ARG OPENRESTY -ARG ARTIFACT -ARG RUNTIME_VERSION - -ENV ITERATION=${ITERATION} -ENV PACKAGE_VERSION=${PACKAGE_VERSION} -ENV PACKAGE_TYPE=${PACKAGE_TYPE} -ENV OPENRESTY=${OPENRESTY} -ENV RUNTIME_VERSION=${RUNTIME_VERSION} -ENV ARTIFACT=${ARTIFACT} - -COPY --from=APISIX /tmp/build/output/apisix /tmp/build/output/apisix -COPY --from=APISIX /tmp/dist /tmp/dist -COPY --from=APISIX /tmp/codename /tmp/codename -COPY --from=APISIX /usr/local/openresty /tmp/build/output/apisix/usr/local/openresty -COPY package-apisix.sh /package-apisix.sh -COPY post-install-apisix-runtime.sh /post-install-apisix-runtime.sh -COPY usr /usr - -RUN /package-apisix.sh \ No newline at end of file diff --git a/dockerfiles/Dockerfile.package.apisix-base b/dockerfiles/Dockerfile.package.apisix-base deleted file mode 100644 index 302163569..000000000 --- a/dockerfiles/Dockerfile.package.apisix-base +++ /dev/null @@ -1,24 +0,0 @@ -ARG VERSION -ARG PACKAGE_TYPE - -FROM apache/apisix-base-${PACKAGE_TYPE}:${VERSION} AS APISIX-BASE -FROM api7/fpm - -ARG ITERATION -ARG PACKAGE_VERSION -ARG PACKAGE_TYPE -ARG ARTIFACT - -ENV ITERATION=${ITERATION} -ENV PACKAGE_VERSION=${PACKAGE_VERSION} -ENV PACKAGE_TYPE=${PACKAGE_TYPE} -ENV ARTIFACT=${ARTIFACT} - -COPY --from=APISIX-BASE /usr/local/openresty /tmp/build/output/openresty -COPY --from=APISIX-BASE /tmp/dist /tmp/dist -COPY --from=APISIX-BASE /tmp/codename /tmp/codename -COPY package-apisix-base.sh /package-apisix-base.sh -COPY post-install-apisix-base.sh /post-install-apisix-base.sh -COPY usr /usr - -RUN /package-apisix-base.sh \ No newline at end of file diff --git a/dockerfiles/Dockerfile.package.apisix-dashboard b/dockerfiles/Dockerfile.package.apisix-dashboard deleted file mode 100644 index b4321b31b..000000000 --- a/dockerfiles/Dockerfile.package.apisix-dashboard +++ /dev/null @@ -1,23 +0,0 @@ -ARG VERSION -ARG PACKAGE_TYPE - -FROM apache/apisix-dashboard-${PACKAGE_TYPE}:${VERSION} AS APISIX -FROM api7/fpm - -ARG ITERATION -ARG PACKAGE_VERSION -ARG PACKAGE_TYPE -ARG ARTIFACT - -ENV ITERATION=${ITERATION} -ENV PACKAGE_VERSION=${PACKAGE_VERSION} -ENV PACKAGE_TYPE=${PACKAGE_TYPE} -ENV ARTIFACT=${ARTIFACT} - -COPY --from=APISIX /tmp/build/output /tmp/build/output -COPY --from=APISIX /tmp/dist /tmp/dist -COPY --from=APISIX /tmp/codename /tmp/codename -COPY package-apisix-dashboard.sh /package-apisix-dashboard.sh -COPY usr /usr - -RUN /package-apisix-dashboard.sh \ No newline at end of file diff --git a/dockerfiles/Dockerfile.package.apisix-runtime b/dockerfiles/Dockerfile.package.apisix-runtime deleted file mode 100644 index 98de37f01..000000000 --- a/dockerfiles/Dockerfile.package.apisix-runtime +++ /dev/null @@ -1,26 +0,0 @@ -ARG PACKAGE_TYPE -ARG RUNTIME_VERSION - -FROM apache/apisix-runtime-${PACKAGE_TYPE}:${RUNTIME_VERSION} AS APISIX-RUNTIME -FROM api7/fpm - -ARG ITERATION -ARG PACKAGE_VERSION -ARG RUNTIME_VERSION -ARG PACKAGE_TYPE -ARG ARTIFACT - -ENV ITERATION=${ITERATION} -ENV PACKAGE_VERSION=${PACKAGE_VERSION} -ENV RUNTIME_VERSION=${RUNTIME_VERSION} -ENV PACKAGE_TYPE=${PACKAGE_TYPE} -ENV ARTIFACT=${ARTIFACT} - -COPY --from=APISIX-RUNTIME /usr/local/openresty /tmp/build/output/openresty -COPY --from=APISIX-RUNTIME /tmp/dist /tmp/dist -COPY --from=APISIX-RUNTIME /tmp/codename /tmp/codename -COPY package-apisix-runtime.sh /package-apisix-runtime.sh -COPY post-install-apisix-runtime.sh /post-install-apisix-runtime.sh -COPY usr /usr - -RUN /package-apisix-runtime.sh diff --git a/package-apisix-runtime.sh b/package-api7ee-runtime.sh similarity index 75% rename from package-apisix-runtime.sh rename to package-api7ee-runtime.sh index d11a8bff6..dd5af2149 100755 --- a/package-apisix-runtime.sh +++ b/package-api7ee-runtime.sh @@ -6,8 +6,8 @@ dist=$(cat /tmp/dist) codename=$(cat /tmp/codename) # Determine the name of artifact -# The defaut is apisix-runtime -artifact="apisix-runtime" +# The defaut is api7ee-runtime-runtime +artifact="api7ee-runtime" if [ "$ARTIFACT" != "0" ]; then artifact=${ARTIFACT} fi @@ -28,11 +28,7 @@ fpm -f -s dir -t "$PACKAGE_TYPE" \ -a "$(uname -i)" \ -v "$RUNTIME_VERSION" \ --iteration "$ITERATION" \ - -x openresty/zlib \ - -x openresty/pcre \ - -d "openresty-zlib >= $openresty_zlib_version" \ - -d "openresty-pcre >= $openresty_pcre_version" \ - --post-install post-install-apisix-runtime.sh \ + --post-install post-install-api7ee-runtime.sh \ --description "APISIX's OpenResty distribution." \ --license "ASL 2.0" \ -C /tmp/build/output \ @@ -49,5 +45,5 @@ fi if [ "$PACKAGE_TYPE" == "deb" ]; then # Rename deb file with adding $DIST section - mv /output/apisix-runtime_"${RUNTIME_VERSION}"-"${ITERATION}"_"${PACKAGE_ARCH}".deb /output/apisix-runtime_"${RUNTIME_VERSION}"-"${ITERATION}"~"${dist}"_"${PACKAGE_ARCH}".deb + mv /output/api7ee-runtime_"${RUNTIME_VERSION}"-"${ITERATION}"_"${PACKAGE_ARCH}".deb /output/api7ee-runtime_"${RUNTIME_VERSION}"-"${ITERATION}"~"${dist}"_"${PACKAGE_ARCH}".deb fi diff --git a/package-apisix-base.sh b/package-apisix-base.sh deleted file mode 100755 index c09132836..000000000 --- a/package-apisix-base.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -set -x -mkdir /output -dist=$(cat /tmp/dist) -codename=$(cat /tmp/codename) - -# Determine the name of artifact -# The defaut is apisix-base -artifact="apisix-base" -if [ "$ARTIFACT" != "0" ]; then - artifact=${ARTIFACT} -fi - -ARCH=${ARCH:-`(uname -m | tr '[:upper:]' '[:lower:]')`} - -openresty_zlib_version="1.2.12-1" -openresty_openssl111_version="1.1.1n-1" -openresty_pcre_version="8.45-1" -if [ "$PACKAGE_TYPE" == "deb" ]; then - pkg_suffix="${codename}1" - openresty_zlib_version="$openresty_zlib_version~$pkg_suffix" - openresty_openssl111_version="$openresty_openssl111_version~$pkg_suffix" - openresty_pcre_version="$openresty_pcre_version~$pkg_suffix" -fi - -fpm -f -s dir -t "$PACKAGE_TYPE" \ - --"$PACKAGE_TYPE"-dist "$dist" \ - -n "$artifact" \ - -a "$(uname -i)" \ - -v "$PACKAGE_VERSION" \ - --iteration "$ITERATION" \ - -x openresty/zlib \ - -x openresty/openssl111 \ - -x openresty/pcre \ - -d "openresty-zlib >= $openresty_zlib_version" \ - -d "openresty-openssl111 >= $openresty_openssl111_version" \ - -d "openresty-pcre >= $openresty_pcre_version" \ - --post-install post-install-apisix-base.sh \ - --description "APISIX's OpenResty distribution." \ - --license "ASL 2.0" \ - -C /tmp/build/output \ - -p /output \ - --url 'http://apisix.apache.org/' \ - --conflicts openresty \ - --config-files usr/lib/systemd/system/openresty.service \ - --prefix=/usr/local - -PACKAGE_ARCH="amd64" -if [[ $ARCH == "arm64" ]] || [[ $ARCH == "aarch64" ]]; then - PACKAGE_ARCH="arm64" -fi - -if [ "$PACKAGE_TYPE" == "deb" ]; then - # Rename deb file with adding $DIST section - mv /output/apisix-base_"${PACKAGE_VERSION}"-"${ITERATION}"_"${PACKAGE_ARCH}".deb /output/apisix-base_"${PACKAGE_VERSION}"-"${ITERATION}"~"${dist}"_"${PACKAGE_ARCH}".deb -fi diff --git a/package-apisix-dashboard.sh b/package-apisix-dashboard.sh deleted file mode 100755 index 5b242dcca..000000000 --- a/package-apisix-dashboard.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -set -x - -mkdir /output -dist=$(cat /tmp/dist) - -# Determine the name of artifact -# The defaut is apisix-dashboard -artifact="apisix-dashboard" -if [ "$ARTIFACT" != "0" ] -then - artifact=${ARTIFACT} -fi - -fpm -f -s dir -t "$PACKAGE_TYPE" \ - --"$PACKAGE_TYPE"-dist "$dist" \ - -n "$artifact" \ - -a "$(uname -i)" \ - -v "$PACKAGE_VERSION" \ - --iteration "$ITERATION" \ - --description 'Apache APISIX Dashboard is designed to make it as easy as possible for users to operate Apache APISIX through a frontend interface.' \ - --license "ASL 2.0" \ - -C /tmp/build/output/apisix/dashboard/ \ - -p /output/ \ - --url 'https://github.com/apache/apisix-dashboard' \ - --config-files usr/lib/systemd/system/apisix-dashboard.service \ - --config-files usr/local/apisix/dashboard/conf/conf.yaml - -# Rename deb file with adding $DIST section -if [ "$PACKAGE_TYPE" == "deb" ] -then - mv /output/apisix-dashboard_"${PACKAGE_VERSION}"-"${ITERATION}"_amd64.deb /output/apisix-dashboard_"${PACKAGE_VERSION}"-"${ITERATION}"~"${dist}"_amd64.deb -fi diff --git a/package-apisix.sh b/package-apisix.sh deleted file mode 100755 index 1ac97b1e5..000000000 --- a/package-apisix.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -set -x -mkdir /output -dist=$(cat /tmp/dist) - -ARCH=${ARCH:-`(uname -m | tr '[:upper:]' '[:lower:]')`} - -# Determine the dependencies -dep_ldap="openldap-devel" -if [ "$PACKAGE_TYPE" == "deb" ] -then - # the pkg contains the so library could be libldap-2.5 or libldap-2.4-2 - dep_ldap="libldap2-dev" -fi -dep_pcre="pcre" -if [ "$PACKAGE_TYPE" == "deb" ] -then - dep_pcre="libpcre3" -fi -dep_which="which" -if [ "$PACKAGE_TYPE" == "deb" ] -then - dep_which="debianutils" -fi - -# Determine the min version of openresty or apisix-base -if [ "$OPENRESTY" == "apisix-base" ] -then - min_or_version="1.21.4.1.7" - max_or_version="1.21.5" -elif [ "$OPENRESTY" == "apisix-base-latest" ] -then - # For CI - OPENRESTY="apisix-base" - min_or_version="latest" - max_or_version="latest-1" -else - min_or_version="1.19.3.2" - max_or_version="1.21.5" -fi - -# Determine the name of artifact -# The defaut is apisix -artifact="apisix" -if [ "$ARTIFACT" != "0" ] -then - artifact=${ARTIFACT} -fi - -if [ "$OPENRESTY" == "apisix-runtime" ] -then - fpm -f -s dir -t "$PACKAGE_TYPE" \ - --"$PACKAGE_TYPE"-dist "$dist" \ - -n "$artifact" \ - -a "$(uname -i)" \ - -v "$PACKAGE_VERSION" \ - --iteration "$ITERATION" \ - -d "$dep_ldap" \ - -d "$dep_pcre" \ - -d "$dep_which" \ - --post-install post-install-apisix-runtime.sh \ - --description 'Apache APISIX is a distributed gateway for APIs and Microservices, focused on high performance and reliability.' \ - --license "ASL 2.0" \ - -C /tmp/build/output/apisix \ - -p /output \ - --url 'http://apisix.apache.org/' \ - --config-files usr/lib/systemd/system/apisix.service \ - --config-files usr/lib/systemd/system/openresty.service \ - --config-files usr/local/apisix/conf/config.yaml \ - --config-files usr/local/apisix/conf/config-default.yaml -else - fpm -f -s dir -t "$PACKAGE_TYPE" \ - --"$PACKAGE_TYPE"-dist "$dist" \ - -n "$artifact" \ - -a "$(uname -i)" \ - -v "$PACKAGE_VERSION" \ - --iteration "$ITERATION" \ - -d "$OPENRESTY >= $min_or_version" \ - -d "$OPENRESTY < $max_or_version" \ - -d "$dep_ldap" \ - -d "$dep_pcre" \ - -d "$dep_which" \ - --description 'Apache APISIX is a distributed gateway for APIs and Microservices, focused on high performance and reliability.' \ - --license "ASL 2.0" \ - -C /tmp/build/output/apisix \ - -p /output \ - --url 'http://apisix.apache.org/' \ - --config-files usr/lib/systemd/system/apisix.service \ - --config-files usr/local/apisix/conf/config.yaml \ - --config-files usr/local/apisix/conf/config-default.yaml -fi - -PACKAGE_ARCH="amd64" -if [[ $ARCH == "arm64" ]] || [[ $ARCH == "aarch64" ]]; then - PACKAGE_ARCH="arm64" -fi - -# Rename deb file with adding $DIST section -if [ "$PACKAGE_TYPE" == "deb" ] -then - mv /output/apisix_${PACKAGE_VERSION}-${ITERATION}_"${PACKAGE_ARCH}".deb /output/apisix_${PACKAGE_VERSION}-${ITERATION}~${dist}_"${PACKAGE_ARCH}".deb -fi diff --git a/post-install-apisix-base.sh b/post-install-api7ee-runtime.sh similarity index 100% rename from post-install-apisix-base.sh rename to post-install-api7ee-runtime.sh diff --git a/post-install-apisix-runtime.sh b/post-install-apisix-runtime.sh deleted file mode 100644 index 1f91343d0..000000000 --- a/post-install-apisix-runtime.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -ln -sf /usr/local/openresty/bin/resty /usr/bin/resty -ln -sf /usr/local/openresty/bin/openresty /usr/bin/openresty \ No newline at end of file diff --git a/utils/build-common.sh b/utils/build-common.sh index affeccbcc..1911ea2ee 100755 --- a/utils/build-common.sh +++ b/utils/build-common.sh @@ -5,98 +5,7 @@ set -x ARCH=${ARCH:-`(uname -m | tr '[:upper:]' '[:lower:]')`} BUILD_PATH=${BUILD_PATH:-`pwd`} -build_apisix_base_rpm() { - if [[ $(rpm --eval '%{centos_ver}') == "7" ]]; then - yum -y install centos-release-scl - yum -y install devtoolset-9 patch wget git make sudo - set +eu - source scl_source enable devtoolset-9 - set -eu - elif [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then - dnf install -y gcc-toolset-9-toolchain patch wget git make sudo - dnf install -y yum-utils - set +eu - source /opt/rh/gcc-toolset-9/enable - set -eu - else - dnf install -y yum-utils - yum -y install --disablerepo=* --enablerepo=ubi-8-appstream-rpms --enablerepo=ubi-8-baseos-rpms gcc gcc-c++ patch wget git make sudo xz - fi - - command -v gcc - gcc --version - - yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo - yum -y install openresty-openssl111-devel openresty-pcre-devel openresty-zlib-devel - - export_apisix_base_openresty_variables - ${BUILD_PATH}/build-apisix-base.sh -} - -build_apisix_base_deb() { - arch_path="" - if [[ $ARCH == "arm64" ]] || [[ $ARCH == "aarch64" ]]; then - arch_path="arm64/" - fi - DEBIAN_FRONTEND=noninteractive apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y sudo git libreadline-dev lsb-release libssl-dev perl build-essential - DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends wget gnupg ca-certificates - wget -O - https://openresty.org/package/pubkey.gpg | apt-key add - - wget -O - http://repos.apiseven.com/pubkey.gpg | apt-key add - - - if [[ $IMAGE_BASE == "ubuntu" ]]; then - echo "deb http://openresty.org/package/${arch_path}ubuntu $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/openresty.list - fi - - if [[ $IMAGE_BASE == "debian" ]]; then - echo "deb http://openresty.org/package/${arch_path}debian $(lsb_release -sc) openresty" | tee /etc/apt/sources.list.d/openresty.list - fi - - DEBIAN_FRONTEND=noninteractive apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y openresty-openssl111-dev openresty-pcre-dev openresty-zlib-dev - - export_apisix_base_openresty_variables - # fix OR_PREFIX - if [[ $build_latest == "latest" ]]; then - unset OR_PREFIX - fi - ${BUILD_PATH}/build-apisix-base.sh ${build_latest} -} - -build_apisix_base_apk() { - export_apisix_base_openresty_variables - ${BUILD_PATH}/build-apisix-base.sh -} - -build_apisix_runtime_rpm() { - if [[ $(rpm --eval '%{centos_ver}') == "7" ]]; then - yum -y install centos-release-scl - yum -y install devtoolset-9 patch wget git make sudo cpanminus - set +eu - source scl_source enable devtoolset-9 - set -eu - elif [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then - dnf install -y gcc-toolset-9-toolchain patch wget git make sudo cpanminus - dnf install -y yum-utils - set +eu - source /opt/rh/gcc-toolset-9/enable - set -eu - else - dnf install -y yum-utils - yum -y install --disablerepo=* --enablerepo=ubi-8-appstream-rpms --enablerepo=ubi-8-baseos-rpms gcc gcc-c++ patch wget git make sudo xz cpanminus - fi - - command -v gcc - gcc --version - - yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo - yum -y install openresty-pcre-devel openresty-zlib-devel - - export_openresty_variables - ${BUILD_PATH}/build-apisix-runtime.sh -} - -build_apisix_runtime_deb() { +build_api7ee_runtime_deb() { arch_path="" if [[ $ARCH == "arm64" ]] || [[ $ARCH == "aarch64" ]]; then arch_path="arm64/" @@ -122,12 +31,7 @@ build_apisix_runtime_deb() { if [[ $build_latest == "latest" ]]; then unset OR_PREFIX fi - ${BUILD_PATH}/build-apisix-runtime.sh ${build_latest} -} - -build_apisix_runtime_apk() { - export_openresty_variables - ${BUILD_PATH}/build-apisix-runtime.sh + ${BUILD_PATH}/build-api7ee-runtime.sh ${build_latest} } export_openresty_variables() { @@ -153,22 +57,7 @@ export_apisix_base_openresty_variables() { case_opt=$1 case ${case_opt} in -build_apisix_base_rpm) - build_apisix_base_rpm - ;; -build_apisix_base_deb) - build_apisix_base_deb - ;; -build_apisix_base_apk) - build_apisix_base_apk - ;; -build_apisix_runtime_rpm) - build_apisix_runtime_rpm - ;; -build_apisix_runtime_deb) - build_apisix_runtime_deb - ;; -build_apisix_runtime_apk) - build_apisix_runtime_apk +build_api7ee_runtime_deb) + build_api7ee_runtime_deb ;; esac diff --git a/utils/publish-deb.sh b/utils/publish-deb.sh index 14bb89687..ac059eed2 100755 --- a/utils/publish-deb.sh +++ b/utils/publish-deb.sh @@ -150,9 +150,9 @@ func_deb_upload() { -exec echo "upload : {}" \; \ -exec sh -c 'coscmd -b "${BUCKET}" -r "${COS_GLOBAL_REGION}" upload {} "/packages/${arch_path}${OS}/pool/${CODENAME}/main/a/apisix-base/${UPLOAD_TARGET_FILE}"' \; - find "${1}" -type f -name "apisix-runtime*.deb" \ + find "${1}" -type f -name "api7ee-runtime*.deb" \ -exec echo "upload : {}" \; \ - -exec sh -c 'coscmd -b "${BUCKET}" -r "${COS_GLOBAL_REGION}" upload {} "/packages/${arch_path}${OS}/pool/${CODENAME}/main/a/apisix-runtime/${UPLOAD_TARGET_FILE}"' \; + -exec sh -c 'coscmd -b "${BUCKET}" -r "${COS_GLOBAL_REGION}" upload {} "/packages/${arch_path}${OS}/pool/${CODENAME}/main/a/api7ee-runtime/${UPLOAD_TARGET_FILE}"' \; }