From e4d77f85c0ec03fdea70988f5c1a4b187ec4f2bd Mon Sep 17 00:00:00 2001 From: imjoey Date: Tue, 28 Sep 2021 18:51:12 +0800 Subject: [PATCH 1/2] chore: Rename apisix-openresty to apisix-base Signed-off-by: imjoey --- ...> package-apisix-base-deb-ubuntu20.04.yml} | 22 +++++----- ...l7.yml => package-apisix-base-rpm-el7.yml} | 22 +++++----- ...ckage-apisix-rpm-el7-with-apisix-base.yml} | 26 +++++------ Makefile | 44 +++++++++---------- README.md | 12 ++--- ...7.sh => build-apisix-base-debug-centos7.sh | 2 +- ...pisix-openresty.sh => build-apisix-base.sh | 2 +- ...enresty.deb => Dockerfile.apisix-base.deb} | 4 +- ...enresty.rpm => Dockerfile.apisix-base.rpm} | 4 +- dockerfiles/Dockerfile.package.apisix-base | 23 ++++++++++ .../Dockerfile.package.apisix-openresty | 23 ---------- ...six-openresty.sh => package-apisix-base.sh | 8 ++-- package-apisix.sh | 6 +-- ...penresty.sh => post-install-apisix-base.sh | 0 utils/build-common.sh | 16 +++---- 15 files changed, 107 insertions(+), 107 deletions(-) rename .github/workflows/{package-apisix-openresty-deb-ubuntu20.04.yml => package-apisix-base-deb-ubuntu20.04.yml} (66%) rename .github/workflows/{package-apisix-openresty-rpm-el7.yml => package-apisix-base-rpm-el7.yml} (56%) rename .github/workflows/{package-apisix-rpm-el7-with-apisix-openresty.yml => package-apisix-rpm-el7-with-apisix-base.yml} (69%) rename build-apisix-openresty-debug-centos7.sh => build-apisix-base-debug-centos7.sh (96%) rename build-apisix-openresty.sh => build-apisix-base.sh (98%) rename dockerfiles/{Dockerfile.apisix-openresty.deb => Dockerfile.apisix-base.deb} (78%) rename dockerfiles/{Dockerfile.apisix-openresty.rpm => Dockerfile.apisix-base.rpm} (78%) create mode 100644 dockerfiles/Dockerfile.package.apisix-base delete mode 100644 dockerfiles/Dockerfile.package.apisix-openresty rename package-apisix-openresty.sh => package-apisix-base.sh (81%) rename post-install-apisix-openresty.sh => post-install-apisix-base.sh (100%) diff --git a/.github/workflows/package-apisix-openresty-deb-ubuntu20.04.yml b/.github/workflows/package-apisix-base-deb-ubuntu20.04.yml similarity index 66% rename from .github/workflows/package-apisix-openresty-deb-ubuntu20.04.yml rename to .github/workflows/package-apisix-base-deb-ubuntu20.04.yml index 39868801d..09e0145e4 100644 --- a/.github/workflows/package-apisix-openresty-deb-ubuntu20.04.yml +++ b/.github/workflows/package-apisix-base-deb-ubuntu20.04.yml @@ -1,4 +1,4 @@ -name: package apisix-openresty deb for ubuntu 20.04(Focal Fossa) +name: package apisix-base deb for ubuntu 20.04(Focal Fossa) on: push: @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest env: - BUILD_APISIX_OR_VERSION: 1.19.3.2.0 + BUILD_APISIX_BASE_VERSION: 1.19.3.2.0 steps: - uses: actions/checkout@v2 @@ -22,11 +22,11 @@ jobs: run: | sudo apt-get install -y make ruby ruby-dev rubygems build-essential - - name: build apisix-openresty deb + - name: build apisix-base deb run: | - make package type=deb app=apisix-openresty version=${BUILD_APISIX_OR_VERSION} image_base=ubuntu image_tag=20.04 + make package type=deb app=apisix-base version=${BUILD_APISIX_BASE_VERSION} image_base=ubuntu image_tag=20.04 - - name: run ubuntu 20.04 docker and mapping apisix-openresty deb into container + - name: run ubuntu 20.04 docker and mapping apisix-base 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 @@ -42,17 +42,17 @@ jobs: - name: install deb in container run: | - docker exec ubuntu20.04Instance bash -c "dpkg -i /output/apisix-openresty_${BUILD_APISIX_OR_VERSION}-0~ubuntu20.04_amd64.deb" + docker exec ubuntu20.04Instance bash -c "dpkg -i /output/apisix-base_${BUILD_APISIX_BASE_VERSION}-0~ubuntu20.04_amd64.deb" - - name: check and ensure openresty is installed + - name: check and ensure apisix-base is installed run: | - export APISIX_OPENRESTY_VER=$(docker exec ubuntu20.04Instance bash -c "openresty -V" 2>&1 | awk '/-O2 -DAPISIX_OPENRESTY_VER=/{print $5}' | awk -v FS="=" '{print $2}') - if [ "$APISIX_OPENRESTY_VER" != "${BUILD_APISIX_OR_VERSION}" ]; then exit 1; fi + export APISIX_BASE_VER=$(docker exec ubuntu20.04Instance bash -c "openresty -V" 2>&1 | awk '/-O2 -DAPISIX_BASE_VER=/{print $5}' | awk -v FS="=" '{print $2}') + if [ "$APISIX_BASE_VER" != "${BUILD_APISIX_BASE_VERSION}" ]; then exit 1; fi - name: Publish Artifact uses: actions/upload-artifact@v2.2.4 with: - name: apisix-openresty_${{ env.BUILD_APISIX_OR_VERSION }}-0~ubuntu20.04_amd64.deb - path: output/apisix-openresty_${{ env.BUILD_APISIX_OR_VERSION }}-0~ubuntu20.04_amd64.deb + name: apisix-base_${{ env.BUILD_APISIX_OR_VERSION }}-0~ubuntu20.04_amd64.deb + path: output/apisix-base_${{ env.BUILD_APISIX_OR_VERSION }}-0~ubuntu20.04_amd64.deb retention-days: 5 if-no-files-found: error diff --git a/.github/workflows/package-apisix-openresty-rpm-el7.yml b/.github/workflows/package-apisix-base-rpm-el7.yml similarity index 56% rename from .github/workflows/package-apisix-openresty-rpm-el7.yml rename to .github/workflows/package-apisix-base-rpm-el7.yml index f48166eb2..13f86f67c 100644 --- a/.github/workflows/package-apisix-openresty-rpm-el7.yml +++ b/.github/workflows/package-apisix-base-rpm-el7.yml @@ -1,4 +1,4 @@ -name: package apisix-openresty rpm for el7 +name: package apisix-base rpm for el7 on: push: @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest env: - BUILD_APISIX_OR_VERSION: 1.19.3.2.0 + BUILD_APISIX_BASE_VERSION: 1.19.3.2.0 steps: - uses: actions/checkout@v2 @@ -22,11 +22,11 @@ jobs: run: | sudo apt-get install -y make ruby ruby-dev rubygems build-essential - - name: build apisix-openresty rpm + - name: build apisix-base rpm run: | - make package type=rpm app=apisix-openresty version=${BUILD_APISIX_OR_VERSION} image_base=centos image_tag=7 + make package type=rpm app=apisix-base version=${BUILD_APISIX_BASE_VERSION} image_base=centos image_tag=7 - - name: run centos7 docker and mapping apisix-openresty rpm into container + - name: run centos7 docker and mapping apisix-base 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 @@ -37,17 +37,17 @@ jobs: - name: install rpm in container run: | - docker exec centos7Instance bash -c "yum -y localinstall /output/apisix-openresty-${BUILD_APISIX_OR_VERSION}-0.el7.x86_64.rpm" + docker exec centos7Instance bash -c "yum -y localinstall /output/apisix-base-${BUILD_APISIX_BASE_VERSION}-0.el7.x86_64.rpm" - - name: check and ensure openresty is installed + - name: check and ensure apisix-base is installed run: | - export APISIX_OPENRESTY_VER=$(docker exec centos7Instance bash -c "openresty -V" 2>&1 | awk '/-O2 -DAPISIX_OPENRESTY_VER=/{print $5}' | awk -v FS="=" '{print $2}') - if [ "$APISIX_OPENRESTY_VER" != "${BUILD_APISIX_OR_VERSION}" ]; then exit 1; fi + export APISIX_BASE_VER=$(docker exec centos7Instance bash -c "openresty -V" 2>&1 | awk '/-O2 -DAPISIX_BASE_VER=/{print $5}' | awk -v FS="=" '{print $2}') + if [ "$APISIX_BASE_VER" != "${BUILD_APISIX_BASE_VERSION}" ]; then exit 1; fi - name: Publish Artifact uses: actions/upload-artifact@v2.2.4 with: - name: apisix-openresty-${{ env.BUILD_APISIX_OR_VERSION }}-0.el7.x86_64.rpm - path: output/apisix-openresty-${{ env.BUILD_APISIX_OR_VERSION }}-0.el7.x86_64.rpm + name: apisix-base-${{ env.BUILD_APISIX_OR_VERSION }}-0.el7.x86_64.rpm + path: output/apisix-base-${{ env.BUILD_APISIX_OR_VERSION }}-0.el7.x86_64.rpm retention-days: 5 if-no-files-found: error diff --git a/.github/workflows/package-apisix-rpm-el7-with-apisix-openresty.yml b/.github/workflows/package-apisix-rpm-el7-with-apisix-base.yml similarity index 69% rename from .github/workflows/package-apisix-rpm-el7-with-apisix-openresty.yml rename to .github/workflows/package-apisix-rpm-el7-with-apisix-base.yml index 389b2ec7e..56ca88980 100644 --- a/.github/workflows/package-apisix-rpm-el7-with-apisix-openresty.yml +++ b/.github/workflows/package-apisix-rpm-el7-with-apisix-base.yml @@ -1,4 +1,4 @@ -name: package apisix rpm depends on apisix-openresty for el7 +name: package apisix rpm depends on apisix-base for el7 on: push: @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest env: - BUILD_APISIX_OR_VERSION: 1.19.3.2.0 + BUILD_APISIX_BASE_VERSION: 1.19.3.2.0 services: etcd: image: bitnami/etcd:3.4.0 @@ -36,12 +36,12 @@ jobs: - name: packaging APISIX run: | - make package type=rpm app=apisix version=2.7 checkout=release/2.7 image_base=centos image_tag=7 openresty=apisix-openresty - make package type=rpm app=apisix version=master checkout=master image_base=centos image_tag=7 openresty=apisix-openresty + make package type=rpm app=apisix version=2.7 checkout=release/2.7 image_base=centos image_tag=7 openresty=apisix-base + make package type=rpm app=apisix version=master checkout=master image_base=centos image_tag=7 openresty=apisix-base - - name: packaging apisix-openresty + - name: packaging apisix-base run: | - make package type=rpm app=apisix-openresty version=${BUILD_APISIX_OR_VERSION} image_base=centos image_tag=7 openresty=apisix-openresty + make package type=rpm app=apisix-base version=${BUILD_APISIX_BASE_VERSION} image_base=centos image_tag=7 - name: run centos7 docker and mapping rpm into container run: | @@ -52,16 +52,16 @@ jobs: 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-openssl111 openresty-pcre openresty-zlib" - - name: install apisix-openresty rpm in container + - name: install apisix-base rpm in container run: | - docker exec centos7Instance bash -c "yum -y localinstall /output/apisix-openresty-${BUILD_APISIX_OR_VERSION}-0.el7.x86_64.rpm" + docker exec centos7Instance bash -c "yum -y localinstall /output/apisix-base-${BUILD_APISIX_BASE_VERSION}-0.el7.x86_64.rpm" - - name: check and ensure apisix-openresty is installed correctly + - name: check and ensure apisix-base is installed correctly run: | - export APISIX_OPENRESTY_VER=$(docker exec centos7Instance bash -c "openresty -V" 2>&1 | awk '/-O2 -DAPISIX_OPENRESTY_VER=/{print $5}' | awk -v FS="=" '{print $2}') - if [ "$APISIX_OPENRESTY_VER" != "${BUILD_APISIX_OR_VERSION}" ]; then exit 1; fi + export APISIX_BASE_VER=$(docker exec centos7Instance bash -c "openresty -V" 2>&1 | awk '/-O2 -DAPISIX_BASE_VER=/{print $5}' | awk -v FS="=" '{print $2}') + if [ "$APISIX_BASE_VER" != "${BUILD_APISIX_BASE_VERSION}" ]; then exit 1; fi - - name: install APISIX which depens on apisix-openresty by rpm in container + - name: install APISIX which depens on apisix-base by rpm in container run: | docker exec centos7Instance bash -c "yum -y localinstall /output/apisix-master-0.el7.x86_64.rpm" docker exec centos7Instance bash -c "apisix start" @@ -77,7 +77,7 @@ jobs: - name: Publish Artifact uses: actions/upload-artifact@v2.2.4 with: - name: apisix-master-0.el7.x86_64.rpm that depends on apisix-openresty + name: apisix-master-0.el7.x86_64.rpm that depends on apisix-base path: output/apisix-master-0.el7.x86_64.rpm retention-days: 5 if-no-files-found: error diff --git a/Makefile b/Makefile index cf1754eb4..98d18fcb4 100644 --- a/Makefile +++ b/Makefile @@ -146,24 +146,24 @@ package-dashboard-rpm: package-dashboard-deb: $(call package,apisix-dashboard,deb) -### build apisix-openresty: -.PHONY: build-apisix-openresty-rpm -build-apisix-openresty-rpm: - $(call build,apisix-openresty,apisix-openresty,rpm,$(local_code_path)) +### build apisix-base: +.PHONY: build-apisix-base-rpm +build-apisix-base-rpm: + $(call build,apisix-base,apisix-base,rpm,$(local_code_path)) -.PHONY: build-apisix-openresty-deb -build-apisix-openresty-deb: - $(call build,apisix-openresty,apisix-openresty,deb,$(local_code_path)) +.PHONY: build-apisix-base-deb +build-apisix-base-deb: + $(call build,apisix-base,apisix-base,deb,$(local_code_path)) -### build rpm for apisix-openresty: -.PHONY: package-apisix-openresty-rpm -package-apisix-openresty-rpm: - $(call package,apisix-openresty,rpm) +### build rpm for apisix-base: +.PHONY: package-apisix-base-rpm +package-apisix-base-rpm: + $(call package,apisix-base,rpm) -### build deb for apisix-openresty: -.PHONY: package-apisix-openresty-deb -package-apisix-openresty-deb: - $(call package,apisix-openresty,deb) +### build deb for apisix-base: +.PHONY: package-apisix-base-deb +package-apisix-base-deb: + $(call package,apisix-base,deb) ### build fpm for packaging: .PHONY: build-fpm @@ -179,7 +179,7 @@ build-fpm: -t api7/fpm - < ./dockerfiles/Dockerfile.fpm endif -ifeq ($(filter $(app),apisix dashboard apisix-openresty),) +ifeq ($(filter $(app),apisix dashboard apisix-base),) $(info the app's value have to be apisix or dashboard!) else ifeq ($(filter $(type),rpm deb),) @@ -188,15 +188,15 @@ $(info the type's value have to be rpm or deb!) else ifeq ($(version), 0) $(info you have to input a version value!) -else ifeq ($(app)_$(type),apisix-openresty_rpm) +else ifeq ($(app)_$(type),apisix-base_rpm) package: build-fpm -package: build-apisix-openresty-rpm -package: package-apisix-openresty-rpm +package: build-apisix-base-rpm +package: package-apisix-base-rpm -else ifeq ($(app)_$(type),apisix-openresty_deb) +else ifeq ($(app)_$(type),apisix-base_deb) package: build-fpm -package: build-apisix-openresty-deb -package: package-apisix-openresty-deb +package: build-apisix-base-deb +package: package-apisix-base-deb else ifeq ($(checkout), 0) $(info you have to input a checkout value!) diff --git a/README.md b/README.md index 40d06440d..2eecb4932 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ |Parameter |Required |Description |Example| |---------|---------|----|-----------| |type |True |it can be `deb` or `rpm` |type=rpm| -|app |True |it can be `apisix`, `dashboard` or `apisix-openresty`|app=apisix| +|app |True |it can be `apisix`, `dashboard` or `apisix-base`|app=apisix| |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` or `apisix-openresty`, the default is `openresty`|openresty=apisix-openresty| +|openresty |False |the openresty type that apisix depends on, its value can be `openresty` or `apisix-base`, the default is `openresty`|openresty=apisix-base| |artifact |False |the final name of the generated artifact, if not specified, this will be the same as `app`|artifact=apisixty| |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| @@ -63,16 +63,16 @@ apisix-dashboard_2.2-0~ubuntu20.04_amd64.deb Packaging a Centos 7 package of APISIX's OpenResty distribution ```sh -make package type=rpm app=apisix-openresty version=1.0.0 image_base=centos image_tag=7 +make package type=rpm app=apisix-base version=1.0.0 image_base=centos image_tag=7 ls output/ -apisix-openresty-1.0.0-0.el7.x86_64.rpm +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-openresty version=1.0.0 +make package type=deb app=apisix-base version=1.0.0 ls output/ -apisix-openresty_1.0.0-0~ubuntu20.04_amd64.deb +apisix-base_1.0.0-0~ubuntu20.04_amd64.deb ``` ## Details diff --git a/build-apisix-openresty-debug-centos7.sh b/build-apisix-base-debug-centos7.sh similarity index 96% rename from build-apisix-openresty-debug-centos7.sh rename to build-apisix-base-debug-centos7.sh index 6f1a834c2..26f2289bd 100755 --- a/build-apisix-openresty-debug-centos7.sh +++ b/build-apisix-base-debug-centos7.sh @@ -16,4 +16,4 @@ export luajit_xcflags="-DLUAJIT_ASSERT -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52C export OR_PREFIX=/usr/local/openresty-debug export debug_args=--with-debug -./build-apisix-openresty.sh +./build-apisix-base.sh diff --git a/build-apisix-openresty.sh b/build-apisix-base.sh similarity index 98% rename from build-apisix-openresty.sh rename to build-apisix-base.sh index 32d7dd05a..8637b7de2 100755 --- a/build-apisix-openresty.sh +++ b/build-apisix-base.sh @@ -71,7 +71,7 @@ no_pool_patch=${no_pool_patch:-} cd openresty-${or_ver} || exit 1 ./configure --prefix="$OR_PREFIX" \ - --with-cc-opt="-DAPISIX_OPENRESTY_VER=$version $cc_opt" \ + --with-cc-opt="-DAPISIX_BASE_VER=$version $cc_opt" \ --with-ld-opt="$ld_opt" \ --add-module=../mod_dubbo \ --add-module=../ngx_multi_upstream_module \ diff --git a/dockerfiles/Dockerfile.apisix-openresty.deb b/dockerfiles/Dockerfile.apisix-base.deb similarity index 78% rename from dockerfiles/Dockerfile.apisix-openresty.deb rename to dockerfiles/Dockerfile.apisix-base.deb index ff3554b4a..0887e7dff 100644 --- a/dockerfiles/Dockerfile.apisix-openresty.deb +++ b/dockerfiles/Dockerfile.apisix-base.deb @@ -4,7 +4,7 @@ ARG IMAGE_TAG="20.04" FROM ${IMAGE_BASE}:${IMAGE_TAG} COPY ./utils/build-common.sh /tmp/build-common.sh -COPY build-apisix-openresty.sh /tmp/build-apisix-openresty.sh +COPY build-apisix-base.sh /tmp/build-apisix-base.sh COPY ./utils/determine-dist.sh /tmp/determine-dist.sh WORKDIR /tmp @@ -17,6 +17,6 @@ ENV IMAGE_BASE=${IMAGE_BASE} ENV IMAGE_TAG=${IMAGE_TAG} ENV version=${VERSION} -RUN ./build-common.sh build_apisix_openresty_deb \ +RUN ./build-common.sh build_apisix_base_deb \ # determine dist and write it into /tmp/dist file && /tmp/determine-dist.sh diff --git a/dockerfiles/Dockerfile.apisix-openresty.rpm b/dockerfiles/Dockerfile.apisix-base.rpm similarity index 78% rename from dockerfiles/Dockerfile.apisix-openresty.rpm rename to dockerfiles/Dockerfile.apisix-base.rpm index 735098dec..051314bc9 100644 --- a/dockerfiles/Dockerfile.apisix-openresty.rpm +++ b/dockerfiles/Dockerfile.apisix-base.rpm @@ -4,7 +4,7 @@ ARG IMAGE_TAG="7" FROM ${IMAGE_BASE}:${IMAGE_TAG} COPY ./utils/build-common.sh /tmp/build-common.sh -COPY build-apisix-openresty.sh /tmp/build-apisix-openresty.sh +COPY build-apisix-base.sh /tmp/build-apisix-base.sh COPY ./utils/determine-dist.sh /tmp/determine-dist.sh WORKDIR /tmp @@ -17,6 +17,6 @@ ENV IMAGE_BASE=${IMAGE_BASE} ENV IMAGE_TAG=${IMAGE_TAG} ENV version=${VERSION} -RUN ./build-common.sh build_apisix_openresty_rpm \ +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.package.apisix-base b/dockerfiles/Dockerfile.package.apisix-base new file mode 100644 index 000000000..1f9af3a8e --- /dev/null +++ b/dockerfiles/Dockerfile.package.apisix-base @@ -0,0 +1,23 @@ +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 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-openresty b/dockerfiles/Dockerfile.package.apisix-openresty deleted file mode 100644 index 94e0f21e1..000000000 --- a/dockerfiles/Dockerfile.package.apisix-openresty +++ /dev/null @@ -1,23 +0,0 @@ -ARG VERSION -ARG PACKAGE_TYPE - -FROM apache/apisix-openresty-${PACKAGE_TYPE}:${VERSION} AS APISIX-OPENRESTY -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-OPENRESTY /usr/local/openresty /tmp/build/output/openresty -COPY --from=APISIX-OPENRESTY /tmp/dist /tmp/dist -COPY package-apisix-openresty.sh /package-apisix-openresty.sh -COPY post-install-apisix-openresty.sh /post-install-apisix-openresty.sh -COPY usr /usr - -RUN /package-apisix-openresty.sh \ No newline at end of file diff --git a/package-apisix-openresty.sh b/package-apisix-base.sh similarity index 81% rename from package-apisix-openresty.sh rename to package-apisix-base.sh index 2cdfde098..8474f35e8 100755 --- a/package-apisix-openresty.sh +++ b/package-apisix-base.sh @@ -5,8 +5,8 @@ mkdir /output dist=$(cat /tmp/dist) # Determine the name of artifact -# The defaut is apisix-openresty -artifact="apisix-openresty" +# The defaut is apisix-base +artifact="apisix-base" if [ "$ARTIFACT" != "0" ]; then artifact=${ARTIFACT} fi @@ -31,7 +31,7 @@ fpm -f -s dir -t "$PACKAGE_TYPE" \ -d "openresty-zlib >= $openresty_zlib_version" \ -d "openresty-openssl111 >= $openresty_openssl111_version" \ -d "openresty-pcre >= $openresty_pcre_version" \ - --post-install post-install-apisix-openresty.sh \ + --post-install post-install-apisix-base.sh \ --description "APISIX's OpenResty distribution." \ --license "ASL 2.0" \ -C /tmp/build/output \ @@ -43,5 +43,5 @@ fpm -f -s dir -t "$PACKAGE_TYPE" \ if [ "$PACKAGE_TYPE" == "deb" ]; then # Rename deb file with adding $DIST section - mv /output/apisix-openresty_"${PACKAGE_VERSION}"-"${ITERATION}"_amd64.deb /output/apisix-openresty_"${PACKAGE_VERSION}"-"${ITERATION}"~"${dist}"_amd64.deb + mv /output/apisix-base_"${PACKAGE_VERSION}"-"${ITERATION}"_amd64.deb /output/apisix-base_"${PACKAGE_VERSION}"-"${ITERATION}"~"${dist}"_amd64.deb fi diff --git a/package-apisix.sh b/package-apisix.sh index 2ead6ef4c..599175508 100755 --- a/package-apisix.sh +++ b/package-apisix.sh @@ -11,11 +11,11 @@ then dep_pcre="libpcre3" fi -# Determine the min version of openresty or apisix-openresty +# Determine the min version of openresty or apisix-base # openresty >= 1.17.8.2 -# apisix-openresty >= 1.19.3.2.0 +# apisix-base >= 1.19.3.2.0 or_version="1.17.8.2" -if [ "$OPENRESTY" == "apisix-openresty" ] +if [ "$OPENRESTY" == "apisix-base" ] then or_version="1.19.3.2.0" fi diff --git a/post-install-apisix-openresty.sh b/post-install-apisix-base.sh similarity index 100% rename from post-install-apisix-openresty.sh rename to post-install-apisix-base.sh diff --git a/utils/build-common.sh b/utils/build-common.sh index 854bc110e..a885269b7 100755 --- a/utils/build-common.sh +++ b/utils/build-common.sh @@ -2,16 +2,16 @@ set -euo pipefail set -x -build_apisix_openresty_rpm() { +build_apisix_base_rpm() { 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-devel openresty-pcre-devel openresty-zlib-devel export_openresty_variables - ./build-apisix-openresty.sh + ./build-apisix-base.sh } -build_apisix_openresty_deb() { +build_apisix_base_deb() { 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 @@ -21,7 +21,7 @@ build_apisix_openresty_deb() { DEBIAN_FRONTEND=noninteractive apt-get install -y openresty-openssl111-dev openresty-pcre-dev openresty-zlib-dev export_openresty_variables - ./build-apisix-openresty.sh + ./build-apisix-base.sh } export_openresty_variables() { @@ -36,10 +36,10 @@ export_openresty_variables() { case_opt=$1 case ${case_opt} in -build_apisix_openresty_rpm) - build_apisix_openresty_rpm +build_apisix_base_rpm) + build_apisix_base_rpm ;; -build_apisix_openresty_deb) - build_apisix_openresty_deb +build_apisix_base_deb) + build_apisix_base_deb ;; esac From 5407a62f9682e453bf679ac711a923f0695d857c Mon Sep 17 00:00:00 2001 From: imjoey Date: Tue, 28 Sep 2021 21:38:25 +0800 Subject: [PATCH 2/2] fix: conflicts Signed-off-by: imjoey --- .github/workflows/package-apisix-base-deb-ubuntu20.04.yml | 4 ++-- .github/workflows/package-apisix-base-rpm-el7.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/package-apisix-base-deb-ubuntu20.04.yml b/.github/workflows/package-apisix-base-deb-ubuntu20.04.yml index 09e0145e4..711a469b5 100644 --- a/.github/workflows/package-apisix-base-deb-ubuntu20.04.yml +++ b/.github/workflows/package-apisix-base-deb-ubuntu20.04.yml @@ -52,7 +52,7 @@ jobs: - name: Publish Artifact uses: actions/upload-artifact@v2.2.4 with: - name: apisix-base_${{ env.BUILD_APISIX_OR_VERSION }}-0~ubuntu20.04_amd64.deb - path: output/apisix-base_${{ env.BUILD_APISIX_OR_VERSION }}-0~ubuntu20.04_amd64.deb + name: apisix-base_${{ env.BUILD_APISIX_BASE_VERSION }}-0~ubuntu20.04_amd64.deb + path: output/apisix-base_${{ env.BUILD_APISIX_BASE_VERSION }}-0~ubuntu20.04_amd64.deb retention-days: 5 if-no-files-found: error diff --git a/.github/workflows/package-apisix-base-rpm-el7.yml b/.github/workflows/package-apisix-base-rpm-el7.yml index 13f86f67c..a9874330b 100644 --- a/.github/workflows/package-apisix-base-rpm-el7.yml +++ b/.github/workflows/package-apisix-base-rpm-el7.yml @@ -47,7 +47,7 @@ jobs: - name: Publish Artifact uses: actions/upload-artifact@v2.2.4 with: - name: apisix-base-${{ env.BUILD_APISIX_OR_VERSION }}-0.el7.x86_64.rpm - path: output/apisix-base-${{ env.BUILD_APISIX_OR_VERSION }}-0.el7.x86_64.rpm + name: apisix-base-${{ env.BUILD_APISIX_BASE_VERSION }}-0.el7.x86_64.rpm + path: output/apisix-base-${{ env.BUILD_APISIX_BASE_VERSION }}-0.el7.x86_64.rpm retention-days: 5 if-no-files-found: error