Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 52 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,63 @@ 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:
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:
- PACKAGE_APISIX_VERSION: 0-latest
- BUILD_APISIX_RUNTIME_VERSION: 1.0.1
BUILD_APISIX_RUNTIME_VERSION: 0-latest
steps:
- checkout
- run:
name: install dependencies
command: |
sudo apt-get install -y make
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: package apisix-runtime
name: install rpm in container
command: |
make package type=deb app=apisix-runtime runtime_version=${BUILD_APISIX_RUNTIME_VERSION}
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: |
make package type=deb app=apisix version=${PACKAGE_APISIX_VERSION} runtime_version=${BUILD_APISIX_RUNTIME_VERSION} checkout=master image_base=ubuntu image_tag=20.04
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: |
Expand Down Expand Up @@ -124,7 +158,7 @@ jobs:
image: ubuntu-2004:202101-01
resource_class: arm.medium
environment:
- VAR_WORKBENCH_DIR: /tmp/output
VAR_WORKBENCH_DIR: /tmp/output
steps:
- checkout
- run:
Expand Down Expand Up @@ -183,6 +217,16 @@ jobs:
# 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:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/package-apisix-deb-ubuntu20.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
env:
PACKAGE_APISIX_VERSION: 3.7.0
BUILD_APISIX_RUNTIME_VERSION: 1.0.1
PACKAGE_APISIX_VERSION: 0.0.0
APISIX_VERSION: 3.7.0
steps:
- uses: actions/checkout@v2

- name: install dependencies
run: |
sudo apt-get install -y make

- name: run apisix packaging
run: |
make package type=deb app=apisix version=${PACKAGE_APISIX_VERSION} runtime_version=${BUILD_APISIX_RUNTIME_VERSION} checkout=master image_base=ubuntu image_tag=20.04
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: |
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/package-apisix-rpm-el7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
env:
PACKAGE_APISIX_VERSION: 3.7.0
BUILD_APISIX_RUNTIME_VERSION: 1.0.1
APISIX_VERSION: 3.7.0
services:
etcd:
image: bitnami/etcd:3.4.0
Expand All @@ -42,12 +41,14 @@ jobs:

- name: packaging APISIX(-remote) with remote code
run: |
make package type=rpm app=apisix version=master checkout=master runtime_version=${BUILD_APISIX_RUNTIME_VERSION} image_base=centos image_tag=7 artifact=apisix-remote
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: |
git clone https://github.com/apache/apisix.git
make package type=rpm app=apisix version=master checkout=master runtime_version=${BUILD_APISIX_RUNTIME_VERSION} image_base=centos image_tag=7 local_code_path=./apisix artifact=apisix-local
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: |
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/package-apisix-rpm-el8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
env:
PACKAGE_APISIX_VERSION: 3.7.0
BUILD_APISIX_RUNTIME_VERSION: 1.0.1
APISIX_VERSION: 3.7.0
services:
etcd:
image: bitnami/etcd:3.4.0
Expand All @@ -42,12 +41,14 @@ jobs:

- name: packaging APISIX(-remote) with remote code
run: |
make package type=rpm app=apisix version=master checkout=master runtime_version=${BUILD_APISIX_RUNTIME_VERSION} image_base=centos image_tag=8 artifact=apisix-remote
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: |
git clone https://github.com/apache/apisix.git
make package type=rpm app=apisix version=master checkout=master runtime_version=${BUILD_APISIX_RUNTIME_VERSION} image_base=centos image_tag=8 local_code_path=./apisix artifact=apisix-local
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: |
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/package-apisix-rpm-ubi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
env:
PACKAGE_APISIX_VERSION: 3.7.0
BUILD_APISIX_RUNTIME_VERSION: 1.0.1
APISIX_VERSION: 3.7.0
services:
etcd:
image: bitnami/etcd:3.4.0
Expand All @@ -40,12 +39,14 @@ jobs:

- name: packaging APISIX(-remote) with remote code
run: |
make package type=rpm app=apisix version=master checkout=master runtime_version=${BUILD_APISIX_RUNTIME_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 artifact=apisix-remote
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: |
git clone https://github.com/apache/apisix.git
make package type=rpm app=apisix version=master checkout=master runtime_version=${BUILD_APISIX_RUNTIME_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 local_code_path=./apisix artifact=apisix-local
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: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
echo "TAG_TYPE=${type}" >> "$GITHUB_ENV"

- name: Check Tags Type
if: ${{ env.TAG_TYPE != 'apisix' && env.TAG_TYPE != 'apisix-base' && env.TAG_TYPE != 'apisix-runtime' }}
if: ${{ env.TAG_TYPE != 'apisix' && env.TAG_TYPE != 'apisix-base' }}
run: |
echo "##[error]Tag type is not correct, please check it."
echo "##[error]Tag type is not correct, or not support, please check it."
exit 1

- name: Build apisix-base deb Package
Expand Down
93 changes: 55 additions & 38 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,29 @@ jobs:
TAG_DATE=$(date +%Y%m%d)
echo "TAG_DATE=${TAG_DATE}" >> "$GITHUB_ENV"

- name: Extract Tags name
- name: Extract Tags version
if: ${{ startsWith(github.ref, 'refs/tags/') }}
id: tag_env
shell: bash
run: |
echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})"
echo "TAG_VERSION=${GITHUB_REF##*/}" >> "$GITHUB_ENV"

- 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/})"
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: ${{ startsWith(steps.tag_type.outputs.version, 'apisix/') }}
if: ${{ env.TAG_TYPE == 'apisix' }}
env:
APISIX_TAG_VERSION: ${{ steps.tag_env.outputs.version}}
APISIX_TAG_VERSION: ${{ env.TAG_VERSION }}
run: |
wget https://raw.githubusercontent.com/apache/apisix/${APISIX_TAG_VERSION}/.requirements
source .requirements
Expand All @@ -64,37 +69,35 @@ jobs:
echo "TARGET_APP=apisix" >> "$GITHUB_ENV"

- name: Build apisix-base RPM Package
if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-base/') }}
if: ${{ env.TAG_TYPE == 'apisix-base' }}
env:
APISIX_BASE_TAG_VERSION: ${{ steps.tag_env.outputs.version}}
APISIX_BASE_TAG_VERSION: ${{ env.TAG_VERSION }}
run: |
# build apisix-base
echo ${{ steps.tag_env.outputs.version}}
echo ${{ steps.tag_type.outputs.version}}
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: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-runtime/') }}
if: ${{ env.TAG_TYPE == 'apisix-runtime' }}
env:
APISIX_RUNTIME_TAG_VERSION: ${{ steps.tag_env.outputs.version}}
APISIX_RUNTIME_TAG_VERSION: ${{ env.TAG_VERSION }}
run: |
# build apisix-runtime
echo ${{ steps.tag_env.outputs.version}}
echo ${{ steps.tag_type.outputs.version}}
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: ${{ startsWith(steps.tag_type.outputs.version, 'dashboard/') }}
if: ${{ env.TAG_TYPE == 'dashboard' }}
env:
APISIX_DASHBOARD_TAG_VERSION: ${{ steps.tag_env.outputs.version}}
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
Expand All @@ -108,53 +111,67 @@ jobs:
ls -al "${VAR_RPM_WORKBENCH_DIR}"

- name: Upload apisix Artifact for Redhat
if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix/') }}
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: "apisix-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm"
name: "${PACKAGE_NAME}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}"

- name: Upload apisix Artifact for Centos
if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix/') }}
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: "apisix-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm"
name: "${PACKAGE_NAME}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}"

- name: Upload apisix-base Artifact for Redhat
if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-base/') }}
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: "apisix-base-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-base-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm"
name: "${PACKAGE_NAME}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}"

- name: Upload apisix-base Artifact for Centos
if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-base/') }}
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: "apisix-base-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-base-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm"
name: "${PACKAGE_NAME}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}"

- name: Upload apisix-runtime Artifact for Redhat
if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-runtime/') }}
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: "apisix-runtime-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-runtime-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm"
name: "${PACKAGE_NAME}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}"

- name: Upload apisix-runtime Artifact for Centos
if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-runtime/') }}
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: "apisix-runtime-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-runtime-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm"
name: "${PACKAGE_NAME}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}"

- name: Upload apisix-dashboard Artifact
if: ${{ startsWith(steps.tag_type.outputs.version, 'dashboard/') }}
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: "apisix-dashboard-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm"
path: "./apisix-dashboard-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm"
name: "${PACKAGE_NAME}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME}"

- name: RPM repo deps init
env:
Expand Down
Loading