From f38d908350b7e46515049e17fcef773363fae196 Mon Sep 17 00:00:00 2001 From: wildone Date: Wed, 7 Jul 2021 07:30:40 +1000 Subject: [PATCH] add pipeline to lease plugin. --- .github/workflows/ubuntu.yml | 90 ++++++++++++++++++++++++++ .gitignore | 1 + configure | 120 +++++++++++++++++++++++++++++++++++ 3 files changed, 211 insertions(+) create mode 100644 .github/workflows/ubuntu.yml create mode 100644 configure diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 0000000..cac1869 --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,90 @@ +name: Ubuntu + +on: + push: + branches: + - fork/* + - master + pull_request: + branches: + - fork/* + - master + release: + types: [created] + +env: + CTEST_OUTPUT_ON_FAILURE: 1 + +jobs: + build: + if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci osx') && !contains(github.event.head_commit.message, 'ci win')" + + runs-on: ubuntu-latest + strategy: + matrix: + nginx: [ '1.21.0', '1.21.1' ] + steps: + + - name: Checkout module + uses: actions/checkout@v2 + with: + submodules: true + lfs: true + fetch-depth: 0 + + - name: Set env + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + echo "GIT_TAG_NAME=$(git describe --tag --always --long)" >> $GITHUB_ENV + echo "GIT_TAG=$(git describe --tag --always --long)" >> $GITHUB_ENV + echo "GIT_RELEASE_NOTES="$(git log $(git describe --tags --abbrev=0 --always)..HEAD --pretty=format:"%h - %s (%an)
")"" >> $GITHUB_ENV + + - name: Create release ${{ env.GIT_TAG }} + if: github.ref == 'refs/heads/master' && strategy.job-index == 0 + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.GIT_TAG }} + release_name: ${{ format('{0}{1}{2}', '', env.GIT_TAG, '') }} + body: ${{ env.GIT_RELEASE_NOTES }} + draft: false + prerelease: false + + - name: Checkout source + uses: actions/checkout@v2 + with: + repository: 'nginx/nginx' #release-1.21.1 + path: 'nginx' + ref: 'release-${{ matrix.nginx }}' + submodules: true + lfs: true + fetch-depth: 0 + + - name: Compile Module + run: | + cp ./configure ./nginx/configure + cd nginx + chmod +x ./configure + ./configure --with-compat --add-dynamic-module=.. + make modules + + + - name: Get release + id: get_release + uses: thebritican/fetch-latest-release@v2.0.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload release asset - nginx/objs/ngx_http_vhost_traffic_status_module-nginx-${{ matrix.nginx }}.so + if: github.ref == 'refs/heads/master' + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ${{ '/home/runner/work/nginx-module-vts/nginx-module-vts/nginx/objs/ngx_http_vhost_traffic_status_module.so' }} + asset_name: ${{ format('{0}{1}{2}', 'ngx_http_vhost_traffic_status_module-nginx-', matrix.nginx, '.so') }} + asset_content_type: application/octet-stream + diff --git a/.gitignore b/.gitignore index 88b68f1..020586e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ t/servroot +/.idea/ diff --git a/configure b/configure new file mode 100644 index 0000000..474d69e --- /dev/null +++ b/configure @@ -0,0 +1,120 @@ +#!/bin/sh + +# Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. + + +LC_ALL=C +export LC_ALL + +. auto/options +. auto/init +. auto/sources + +test -d $NGX_OBJS || mkdir -p $NGX_OBJS + +echo > $NGX_AUTO_HEADERS_H +echo > $NGX_AUTOCONF_ERR + +echo "#define NGX_CONFIGURE \"$NGX_CONFIGURE\"" > $NGX_AUTO_CONFIG_H + + +if [ $NGX_DEBUG = YES ]; then + have=NGX_DEBUG . auto/have +fi + + +if test -z "$NGX_PLATFORM"; then + echo "checking for OS" + + NGX_SYSTEM=`uname -s 2>/dev/null` + NGX_RELEASE=`uname -r 2>/dev/null` + NGX_MACHINE=`uname -m 2>/dev/null` + + echo " + $NGX_SYSTEM $NGX_RELEASE $NGX_MACHINE" + + NGX_PLATFORM="$NGX_SYSTEM:$NGX_RELEASE:$NGX_MACHINE"; + + case "$NGX_SYSTEM" in + MINGW32_* | MINGW64_* | MSYS_*) + NGX_PLATFORM=win32 + ;; + esac + +else + echo "building for $NGX_PLATFORM" + NGX_SYSTEM=$NGX_PLATFORM +fi + +. auto/cc/conf + +if [ "$NGX_PLATFORM" != win32 ]; then + . auto/headers +fi + +. auto/os/conf + +if [ "$NGX_PLATFORM" != win32 ]; then + . auto/unix +fi + +. auto/threads +. auto/modules +. auto/lib/conf + +case ".$NGX_PREFIX" in + .) + NGX_PREFIX=${NGX_PREFIX:-/usr/local/nginx} + have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define + ;; + + .!) + NGX_PREFIX= + ;; + + *) + have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define + ;; +esac + +if [ ".$NGX_CONF_PREFIX" != "." ]; then + have=NGX_CONF_PREFIX value="\"$NGX_CONF_PREFIX/\"" . auto/define +fi + +have=NGX_SBIN_PATH value="\"$NGX_SBIN_PATH\"" . auto/define +have=NGX_CONF_PATH value="\"$NGX_CONF_PATH\"" . auto/define +have=NGX_PID_PATH value="\"$NGX_PID_PATH\"" . auto/define +have=NGX_LOCK_PATH value="\"$NGX_LOCK_PATH\"" . auto/define +have=NGX_ERROR_LOG_PATH value="\"$NGX_ERROR_LOG_PATH\"" . auto/define + +if [ ".$NGX_ERROR_LOG_PATH" = "." ]; then + have=NGX_ERROR_LOG_STDERR . auto/have +fi + +have=NGX_HTTP_LOG_PATH value="\"$NGX_HTTP_LOG_PATH\"" . auto/define +have=NGX_HTTP_CLIENT_TEMP_PATH value="\"$NGX_HTTP_CLIENT_TEMP_PATH\"" +. auto/define +have=NGX_HTTP_PROXY_TEMP_PATH value="\"$NGX_HTTP_PROXY_TEMP_PATH\"" +. auto/define +have=NGX_HTTP_FASTCGI_TEMP_PATH value="\"$NGX_HTTP_FASTCGI_TEMP_PATH\"" +. auto/define +have=NGX_HTTP_UWSGI_TEMP_PATH value="\"$NGX_HTTP_UWSGI_TEMP_PATH\"" +. auto/define +have=NGX_HTTP_SCGI_TEMP_PATH value="\"$NGX_HTTP_SCGI_TEMP_PATH\"" +. auto/define + +. auto/make +. auto/lib/make +. auto/install + +# STUB +. auto/stubs + +have=NGX_USER value="\"$NGX_USER\"" . auto/define +have=NGX_GROUP value="\"$NGX_GROUP\"" . auto/define + +if [ ".$NGX_BUILD" != "." ]; then + have=NGX_BUILD value="\"$NGX_BUILD\"" . auto/define +fi + +. auto/summary