-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packaging: completely remove td-agent-bit builds
Signed-off-by: Patrick Stephens <[email protected]>
- Loading branch information
1 parent
d6dc1e9
commit 17004ca
Showing
32 changed files
with
228 additions
and
960 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
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
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 |
---|---|---|
|
@@ -32,7 +32,7 @@ on: | |
description: Optionally add metadata to build to indicate an unstable build, set to the contents you want to add. | ||
type: string | ||
required: false | ||
default: '' | ||
default: "" | ||
secrets: | ||
token: | ||
description: The Github token or similar to authenticate with for the registry. | ||
|
@@ -47,7 +47,6 @@ jobs: | |
call-build-images-meta: | ||
name: Extract any supporting metadata | ||
outputs: | ||
build-type: ${{ steps.determine-build-type.outputs.BUILD_TYPE }} | ||
major-version: ${{ steps.determine-major-version.outputs.replaced }} | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
|
@@ -59,171 +58,20 @@ jobs: | |
with: | ||
ref: ${{ inputs.ref }} | ||
|
||
# Determine if this is a 1.8 type of build which is different | ||
- name: Determine build type | ||
id: determine-build-type | ||
run: | | ||
BUILD_TYPE="1.8" | ||
if [[ -f "dockerfiles/Dockerfile" ]]; then | ||
BUILD_TYPE="modern" | ||
fi | ||
echo "Detected type: $BUILD_TYPE" | ||
echo ::set-output name=BUILD_TYPE::$BUILD_TYPE | ||
shell: bash | ||
|
||
# For main branch/releases we want to also tag with the major version. | ||
# For main branch/releases we want to tag with the major version. | ||
# E.g. if we build version 1.9.2 we want to tag with 1.9.2 and 1.9. | ||
- name: Determine major version tag | ||
id: determine-major-version | ||
uses: frabert/[email protected] | ||
with: | ||
pattern: '^(\d+\.\d+).*$' | ||
string: ${{ inputs.version }} | ||
replace-with: '$1' | ||
flags: 'g' | ||
|
||
# For 1.8 builds it is a little more complex so we have this build matrix to handle it. | ||
# This creates separate images for each architecture. | ||
# The later step then creates a multi-arch manifest for all of these. | ||
call-build-legacy-images-matrix: | ||
if: needs.call-build-images-meta.outputs.build-type == '1.8' | ||
name: Build single arch legacy images | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
needs: | ||
- call-build-images-meta | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: [ amd64, arm64, arm/v7 ] | ||
include: | ||
- arch: amd64 | ||
suffix: x86_64 | ||
- arch: arm/v7 | ||
suffix: arm32v7 | ||
- arch: arm64 | ||
suffix: arm64v8 | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout the docker build repo for legacy builds | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: fluent/fluent-bit-docker-image | ||
ref: '1.8' # Fixed to this branch | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ inputs.registry }} | ||
username: ${{ inputs.username }} | ||
password: ${{ secrets.token }} | ||
|
||
- id: debug-meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ inputs.registry }}/${{ inputs.image }} | ||
tags: | | ||
raw,${{ inputs.version }}-debug | ||
raw,${{ needs.call-build-images-meta.outputs.major-version }}-debug | ||
- name: Build the legacy x86_64 debug image | ||
if: matrix.arch == 'amd64' | ||
uses: docker/build-push-action@v3 | ||
with: | ||
file: ./Dockerfile.x86_64.debug | ||
context: . | ||
tags: ${{ steps.debug-meta.outputs.tags }} | ||
labels: ${{ steps.debug-meta.outputs.labels }} | ||
platforms: linux/amd64 | ||
push: true | ||
load: false | ||
build-args: | | ||
FLB_TARBALL=https://github.com/fluent/fluent-bit/tarball/${{ inputs.ref }} | ||
- name: Extract metadata from Github | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ inputs.registry }}/${{ inputs.image }} | ||
tags: | | ||
raw,${{ matrix.suffix }}-${{ inputs.version }} | ||
- name: Build the legacy ${{ matrix.arch }} image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
file: ./Dockerfile.${{ matrix.suffix }} | ||
context: . | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/${{ matrix.arch }} | ||
push: true | ||
load: false | ||
build-args: | | ||
FLB_TARBALL=https://github.com/fluent/fluent-bit/tarball/${{ inputs.ref }} | ||
# Create a multi-arch manifest for the separate 1.8 images. | ||
call-build-legacy-image-manifests: | ||
if: needs.call-build-images-meta.outputs.build-type == '1.8' | ||
name: Deploy multi-arch container image manifests | ||
permissions: | ||
contents: read | ||
packages: write | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
needs: | ||
- call-build-images-meta | ||
- call-build-legacy-images-matrix | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ inputs.registry }} | ||
username: ${{ inputs.username }} | ||
password: ${{ secrets.token }} | ||
|
||
- name: Pull all the images | ||
# Use platform to trigger warnings on invalid image metadata | ||
run: | | ||
docker pull --platform=linux/amd64 ${{ inputs.registry }}/${{ inputs.image }}:x86_64-${{ inputs.version }} | ||
docker pull --platform=linux/arm64 ${{ inputs.registry }}/${{ inputs.image }}:arm64v8-${{ inputs.version }} | ||
docker pull --platform=linux/arm/v7 ${{ inputs.registry }}/${{ inputs.image }}:arm32v7-${{ inputs.version }} | ||
- name: Create manifests for images | ||
# Latest is 1.9, not 1.8 now | ||
run: | | ||
docker manifest create ${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }} \ | ||
--amend ${{ inputs.registry }}/${{ inputs.image }}:x86_64-${{ inputs.version }} \ | ||
--amend ${{ inputs.registry }}/${{ inputs.image }}:arm64v8-${{ inputs.version }} \ | ||
--amend ${{ inputs.registry }}/${{ inputs.image }}:arm32v7-${{ inputs.version }} | ||
docker manifest push --purge ${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }} | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: enabled | ||
shell: bash | ||
|
||
- name: Create major version manifest | ||
if: needs.call-build-images-meta.outputs.major-version != inputs.version | ||
run: | | ||
docker manifest push --purge ${{ inputs.registry }}/${{ inputs.image }}:${{ needs.call-build-images-meta.outputs.major-version }} | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: enabled | ||
shell: bash | ||
replace-with: "$1" | ||
flags: "g" | ||
|
||
# This is the intended approach to multi-arch image and all the other checks scanning, | ||
# signing, etc only trigger from this. | ||
# 1.8 images are legacy and were not scanned or signed previously so this keeps it simple. | ||
call-build-images: | ||
if: needs.call-build-images-meta.outputs.build-type != '1.8' | ||
needs: | ||
- call-build-images-meta | ||
name: Multiarch container images to GHCR | ||
|
@@ -304,7 +152,6 @@ jobs: | |
needs: | ||
- call-build-images-meta | ||
- call-build-images | ||
if: needs.call-build-images-meta.outputs.build-type != '1.8' | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
permissions: | ||
|
@@ -332,7 +179,6 @@ jobs: | |
if-no-files-found: error | ||
|
||
call-build-images-scan: | ||
if: needs.call-build-images-meta.outputs.build-type != '1.8' | ||
needs: | ||
- call-build-images-meta | ||
- call-build-images | ||
|
@@ -353,22 +199,21 @@ jobs: | |
- name: Trivy - multi-arch | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: '${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }}' | ||
format: 'table' | ||
exit-code: '1' | ||
image-ref: "${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }}" | ||
format: "table" | ||
exit-code: "1" | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
vuln-type: "os,library" | ||
severity: "CRITICAL,HIGH" | ||
|
||
- name: Dockle - multi-arch | ||
uses: hands-lab/dockle-action@v1 | ||
with: | ||
image: '${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }}' | ||
exit-code: '1' | ||
image: "${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }}" | ||
exit-code: "1" | ||
exit-level: WARN | ||
|
||
call-build-images-sign: | ||
if: needs.call-build-images-meta.outputs.build-type != '1.8' | ||
needs: | ||
- call-build-images-meta | ||
- call-build-images | ||
|
@@ -428,7 +273,6 @@ jobs: | |
|
||
# This takes a long time... | ||
call-build-windows-container: | ||
if: needs.call-build-images-meta.outputs.build-type != '1.8' | ||
name: Windows container image | ||
runs-on: windows-2019 | ||
environment: ${{ inputs.environment }} | ||
|
Oops, something went wrong.