forked from api7/lua-resty-limit-traffic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add CI for the apisix-openresty build and install rpm (openrest…
- Loading branch information
1 parent
91acbd9
commit d16922e
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: package apisix-openresty | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
BUILD_APISIX_OR_VERSION: 1.0.0 | ||
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: build apisix-openresty rpm | ||
run: | | ||
make package type=rpm app=apisix-openresty version=${BUILD_APISIX_OR_VERSION} | ||
- name: run centos7 docker and mapping apisix-openresty 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-openssl111 openresty-pcre openresty-zlib" | ||
- name: install rpm in container | ||
run: | | ||
docker exec centos7Instance bash -c "yum -y localinstall /output/apisix-openresty-${BUILD_APISIX_OR_VERSION}-0.x86_64.rpm" | ||
- name: check and ensure openresty 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 | ||