Skip to content

Commit

Permalink
feat: Add CI for the apisix-openresty build and install rpm (openrest…
Browse files Browse the repository at this point in the history
  • Loading branch information
tzssangglass authored Jun 12, 2021
1 parent 91acbd9 commit d16922e
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/package-apisix-openresty.yml
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

0 comments on commit d16922e

Please sign in to comment.