ci: test #118
Workflow file for this run
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
name: package apisix-base 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_BASE_VERSION: 1.21.4.1.9 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install dependencies | |
run: | | |
sudo apt-get install -y make ruby ruby-dev rubygems build-essential | |
- name: build apisix-base rpm | |
run: | | |
make package type=rpm app=apisix-base version=${BUILD_APISIX_BASE_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 | |
- name: run ubi8 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 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-openssl111 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-base-${BUILD_APISIX_BASE_VERSION}-0.ubi8.6.x86_64.rpm" | |
- name: check and ensure apisix-base is installed | |
run: | | |
docker exec ubiInstance bash -c "/usr/local/openresty/bin/etcdctl -h" || exit 1 | |
export APISIX_BASE_VER=$(docker exec ubiInstance 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-base-${{ env.BUILD_APISIX_BASE_VERSION }}-0.ubi8.6.x86_64.rpm | |
path: output/apisix-base-${{ env.BUILD_APISIX_BASE_VERSION }}-0.ubi8.6.x86_64.rpm | |
retention-days: 5 | |
if-no-files-found: error |