From 98323985881cfb2b098502f72b94289c6f332c19 Mon Sep 17 00:00:00 2001 From: Eoin O'Shaughnessy Date: Tue, 2 Jul 2024 13:44:11 +0100 Subject: [PATCH 1/8] initial add of ot build --- .github/workflows/build-ot-dependency.yml | 96 +++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/build-ot-dependency.yml diff --git a/.github/workflows/build-ot-dependency.yml b/.github/workflows/build-ot-dependency.yml new file mode 100644 index 0000000000..5fd24f03b5 --- /dev/null +++ b/.github/workflows/build-ot-dependency.yml @@ -0,0 +1,96 @@ +name: Build OpenTracing Dependency + +on: + # push: + # branches: + # - "ot-build" + workflow_dispatch: + inputs: + nginx_version: + type: string + description: "NGINX Version to build" + required: false + +env: + PLATFORMS: "linux/arm,linux/amd64,linux/arm64,linux/ppc64le,linux/s390x" + +concurrency: + group: ${{ github.ref_name }}-ot-build + cancel-in-progress: true + +jobs: + build-docker: + name: Build Docker Image + runs-on: ubuntu-22.04 + permissions: + packages: write + contents: read + strategy: + fail-fast: false + matrix: + os: [debian, alpine] + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + repository: opentracing-contrib/nginx-opentracing + ref: master + + - name: Variables + id: var + run: | + if [ -z "${{ inputs.nginx_version }}" ]; then + nginx_version="${{ inputs.nginx_version }}" + else + nginx_version=$(grep -m1 'ARG BUILD_NGINX_VERSION=' > $GITHUB_OUTPUT + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64,ppc64le,s390x + + - name: Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + buildkitd-flags: --debug + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + if: github.event_name != 'pull_request' + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + name=ghcr.io/nginx/nic-ot-dependency,enable=true + flavor: suffix=${{ matrix.os != 'debian' && '-' || '' }}${{ matrix.os != 'debian' && matrix.os || '' }},onlatest=true + tags: | + type=raw,value=nginx-${{ steps.var.outputs.nginx_version }},enable=true + env: + DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index + + - name: Build and push + uses: docker/build-push-action@v5 + with: + file: ./Dockerfile + context: "." + pull: true + push: true + platforms: "linux/arm,linux/amd64,linux/arm64,linux/ppc64le,linux/s390x" + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + annotations: ${{ steps.meta.outputs.annotations }} + cache-from: type=gha,scope=${{ matrix.os }} + cache-to: type=gha,scope=${{ matrix.os }},mode=max + target: final + sbom: false + provenance: mode=max + build-args: BUILD_OS=${{ matrix.os }} From ab1a82cebb5d890fc8588f651be49fafb396e2d4 Mon Sep 17 00:00:00 2001 From: oseoin Date: Tue, 2 Jul 2024 16:32:13 +0100 Subject: [PATCH 2/8] Update .github/workflows/build-ot-dependency.yml Co-authored-by: Paul Abel <128620221+pdabelf5@users.noreply.github.com> Signed-off-by: oseoin --- .github/workflows/build-ot-dependency.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ot-dependency.yml b/.github/workflows/build-ot-dependency.yml index 5fd24f03b5..b3c3f0f952 100644 --- a/.github/workflows/build-ot-dependency.yml +++ b/.github/workflows/build-ot-dependency.yml @@ -71,7 +71,7 @@ jobs: with: images: | name=ghcr.io/nginx/nic-ot-dependency,enable=true - flavor: suffix=${{ matrix.os != 'debian' && '-' || '' }}${{ matrix.os != 'debian' && matrix.os || '' }},onlatest=true + flavor: suffix=${{ matrix.os != 'debian' && format('-{0}', matrix.os) || '' }},onlatest=true tags: | type=raw,value=nginx-${{ steps.var.outputs.nginx_version }},enable=true env: From b8ec9f98e9cfd64b3f109282229c5b7d59642a37 Mon Sep 17 00:00:00 2001 From: Eoin O'Shaughnessy Date: Tue, 2 Jul 2024 16:42:27 +0100 Subject: [PATCH 3/8] upstream changes --- .github/workflows/build-ot-dependency.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-ot-dependency.yml b/.github/workflows/build-ot-dependency.yml index b3c3f0f952..040ade555c 100644 --- a/.github/workflows/build-ot-dependency.yml +++ b/.github/workflows/build-ot-dependency.yml @@ -1,9 +1,9 @@ name: Build OpenTracing Dependency on: - # push: - # branches: - # - "ot-build" + push: + branches: + - "ot-build" workflow_dispatch: inputs: nginx_version: @@ -42,7 +42,7 @@ jobs: if [ -z "${{ inputs.nginx_version }}" ]; then nginx_version="${{ inputs.nginx_version }}" else - nginx_version=$(grep -m1 'ARG BUILD_NGINX_VERSION=' > $GITHUB_OUTPUT @@ -93,4 +93,6 @@ jobs: target: final sbom: false provenance: mode=max - build-args: BUILD_OS=${{ matrix.os }} + build-args: | + BUILD_OS=${{ matrix.os }} + NGINX_VERSION=${{ steps.var.outputs.nginx_version }} From 222749141bfa1d476252132d80c8d885639186ec Mon Sep 17 00:00:00 2001 From: Eoin O'Shaughnessy Date: Wed, 3 Jul 2024 08:39:43 +0100 Subject: [PATCH 4/8] fix ot repo --- .github/workflows/build-ot-dependency.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ot-dependency.yml b/.github/workflows/build-ot-dependency.yml index 040ade555c..1bcfb5a290 100644 --- a/.github/workflows/build-ot-dependency.yml +++ b/.github/workflows/build-ot-dependency.yml @@ -70,7 +70,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - name=ghcr.io/nginx/nic-ot-dependency,enable=true + name=ghcr.io/nginxinc/nic-ot-dependency,enable=true flavor: suffix=${{ matrix.os != 'debian' && format('-{0}', matrix.os) || '' }},onlatest=true tags: | type=raw,value=nginx-${{ steps.var.outputs.nginx_version }},enable=true From c92cb544cf1b79b5777993cb7be86b055d19b770 Mon Sep 17 00:00:00 2001 From: Eoin O'Shaughnessy Date: Wed, 3 Jul 2024 13:31:27 +0100 Subject: [PATCH 5/8] fix version tag --- .github/workflows/build-ot-dependency.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ot-dependency.yml b/.github/workflows/build-ot-dependency.yml index 1bcfb5a290..dfb805ba2a 100644 --- a/.github/workflows/build-ot-dependency.yml +++ b/.github/workflows/build-ot-dependency.yml @@ -39,7 +39,7 @@ jobs: - name: Variables id: var run: | - if [ -z "${{ inputs.nginx_version }}" ]; then + if [ -n "${{ inputs.nginx_version }}" ]; then nginx_version="${{ inputs.nginx_version }}" else nginx_version=$(grep -m1 'FROM nginx:' Date: Wed, 3 Jul 2024 13:53:13 +0100 Subject: [PATCH 6/8] change package name --- .github/workflows/build-ot-dependency.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-ot-dependency.yml b/.github/workflows/build-ot-dependency.yml index dfb805ba2a..47d20b36e9 100644 --- a/.github/workflows/build-ot-dependency.yml +++ b/.github/workflows/build-ot-dependency.yml @@ -1,14 +1,13 @@ name: Build OpenTracing Dependency on: - push: - branches: - - "ot-build" + schedule: + - cron: "30 4 * * 1" # run Mon at 04:30 UTC workflow_dispatch: inputs: nginx_version: type: string - description: "NGINX Version to build" + description: "NGINX Version to build OT for" required: false env: @@ -70,7 +69,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - name=ghcr.io/nginxinc/nic-ot-dependency,enable=true + name=ghcr.io/nginxinc/dependencies/nginx-ot,enable=true flavor: suffix=${{ matrix.os != 'debian' && format('-{0}', matrix.os) || '' }},onlatest=true tags: | type=raw,value=nginx-${{ steps.var.outputs.nginx_version }},enable=true From eb8802765f14e463174e325dd550acff87dadbea Mon Sep 17 00:00:00 2001 From: Eoin O'Shaughnessy Date: Wed, 3 Jul 2024 13:54:43 +0100 Subject: [PATCH 7/8] force build --- .github/workflows/build-ot-dependency.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-ot-dependency.yml b/.github/workflows/build-ot-dependency.yml index 47d20b36e9..675cc517d8 100644 --- a/.github/workflows/build-ot-dependency.yml +++ b/.github/workflows/build-ot-dependency.yml @@ -1,6 +1,9 @@ name: Build OpenTracing Dependency on: + push: + branches: + - "ot-build" schedule: - cron: "30 4 * * 1" # run Mon at 04:30 UTC workflow_dispatch: From 098079a942ba850b4c2dd62ed357a81e03f31c00 Mon Sep 17 00:00:00 2001 From: Eoin O'Shaughnessy Date: Thu, 4 Jul 2024 14:22:32 +0100 Subject: [PATCH 8/8] exclude new workflow --- .github/scripts/exclude_ci_files.txt | 1 + .github/workflows/build-ot-dependency.yml | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/scripts/exclude_ci_files.txt b/.github/scripts/exclude_ci_files.txt index f012ba28c3..447f58073e 100644 --- a/.github/scripts/exclude_ci_files.txt +++ b/.github/scripts/exclude_ci_files.txt @@ -13,6 +13,7 @@ .github/scripts/release-notes-update.sh .github/scripts/release-version-update.sh .github/workflows/build-base-images.yml +.github/workflows/build-ot-dependency.yml .github/workflows/build-test-image.yml .github/workflows/cache-update.yml .github/workflows/cherry-pick.yml diff --git a/.github/workflows/build-ot-dependency.yml b/.github/workflows/build-ot-dependency.yml index 675cc517d8..47d20b36e9 100644 --- a/.github/workflows/build-ot-dependency.yml +++ b/.github/workflows/build-ot-dependency.yml @@ -1,9 +1,6 @@ name: Build OpenTracing Dependency on: - push: - branches: - - "ot-build" schedule: - cron: "30 4 * * 1" # run Mon at 04:30 UTC workflow_dispatch: