Skip to content

Commit

Permalink
chore: set version and release_number labels in ubi image
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Rosiek <[email protected]>
  • Loading branch information
Dominik Rosiek committed Jun 3, 2024
1 parent 7659a32 commit 3cf903d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 25 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/dev_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- 'release-v[0-9]+.[0-9]+'
- 'dev-build/*'

env:
SIDECAR_IMAGE: "ghcr.io/sumologic/tailing-sidecar"
Expand Down Expand Up @@ -42,13 +43,13 @@ jobs:
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Build and push tailing sidecar ubi image
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} TAG=${{ env.SIDECAR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar image with latest tag
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar ubi image with latest tag
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

- name: Log in to AWS Public ECR to publish tailing sidecar image
Expand All @@ -60,13 +61,13 @@ jobs:
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Build and push to ECR tailing sidecar ubi image
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar image with latest tag to ECR
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar ubi image with latest tag to ECR
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

- name: Login to Docker Hub
Expand All @@ -78,13 +79,13 @@ jobs:
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Build and push tailing sidecar ubi image
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar image with latest tag
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar ubi image with latest tag
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

build-otelcol-sidecar:
Expand Down Expand Up @@ -156,13 +157,13 @@ jobs:
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Build and push tailing sidecar operator ubi image
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} IMG=${{ env.OPERATOR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Push tailing sidecar operator image with latest tag
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./operator
- name: Push tailing sidecar operator ubi image with latest tag
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} IMG=${{ env.OPERATOR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./operator

- name: Log in to AWS Public ECR to publish tailing sidecar operator image
Expand All @@ -174,13 +175,13 @@ jobs:
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Build and push to ECR tailing sidecar operator ubi image
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Push tailing sidecar operator image with latest tag to ECR
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./operator
- name: Push tailing sidecar operator ubi image with latest tag to ECR
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./operator

- name: Login to Docker Hub
Expand All @@ -192,13 +193,13 @@ jobs:
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Build and push tailing sidecar operator ubi image
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Push tailing sidecar operator image with latest tag
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./operator
- name: Push tailing sidecar operator ubi image with latest tag
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./operator

push-helm-chart:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/release_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ jobs:
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Build and push tailing sidecar ubi image
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} TAG=${{ env.SIDECAR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar image with latest tag
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar ubi image with latest tag
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

- name: Log in to AWS Public ECR to publish tailing sidecar image
Expand All @@ -59,13 +59,13 @@ jobs:
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Build and push to ECR tailing sidecar ubi image
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar image with latest tag to ECR
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar ubi image with latest tag to ECR
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} TAG=${{ env.SIDECAR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

- name: Login to Docker Hub
Expand All @@ -77,13 +77,13 @@ jobs:
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Build and push tailing sidecar ubi image
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar image with latest tag
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit
- name: Push tailing sidecar ubi image with latest tag
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} TAG=${{ env.SIDECAR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar/fluentbit

build-operator:
Expand Down Expand Up @@ -115,13 +115,13 @@ jobs:
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Build and push tailing sidecar operator ubi image
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} IMG=${{ env.OPERATOR_IMAGE }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Push tailing sidecar operator image with latest tag
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./operator
- name: Push tailing sidecar operator ubi image with latest tag
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} IMG=${{ env.OPERATOR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./operator

- name: Log in to AWS Public ECR to publish tailing sidecar operator image
Expand All @@ -133,13 +133,13 @@ jobs:
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Build and push to ECR tailing sidecar operator ubi image
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Push tailing sidecar operator image with latest tag to ECR
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./operator
- name: Push tailing sidecar operator ubi image with latest tag to ECR
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} IMG=${{ env.OPERATOR_IMAGE_ECR }}:${{ env.LATEST_TAG }}
working-directory: ./operator

- name: Login to Docker Hub
Expand All @@ -151,13 +151,13 @@ jobs:
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Build and push tailing sidecar operator ubi image
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
run: make build-push-ubi VERSION=${{ steps.extract_tag.outputs.tag }} IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ steps.extract_tag.outputs.tag }}
working-directory: ./operator
- name: Push tailing sidecar operator image with latest tag
run: make build-push-multiplatform IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./operator
- name: Push tailing sidecar operator ubi image with latest tag
run: make build-push-ubi IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
run: make build-push-ubi VERSION=${{ env.LATEST_TAG }} IMG=${{ env.OPERATOR_IMAGE_DOCKERHUB }}:${{ env.LATEST_TAG }}
working-directory: ./operator

push-helm-chart:
Expand Down
9 changes: 8 additions & 1 deletion operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ else
GOBIN=$(shell go env GOBIN)
endif

# UBI image variables
RELEASE_NUMBER ?= "1"

# Run tests
# Set default shell as bash
SHELL := /bin/bash
Expand Down Expand Up @@ -175,7 +178,11 @@ generate: controller-gen

# Build the docker image
docker-build:
docker build . -f ${DOCKERFILE} -t ${IMG}
docker build . \
--build-arg RELEASE_NUMBER=$(RELEASE_NUMBER) \
--build-arg VERSION=$(VERSION) \
-f ${DOCKERFILE} \
-t ${IMG}

# Push the docker image
docker-push:
Expand Down
4 changes: 4 additions & 0 deletions sidecar/fluentbit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ root_dir := $(dir $(abspath $(mkfile_path)/..))

TAG ?= "localhost:32000/sumologic/tailing-sidecar:latest"
DOCKERFILE ?= Dockerfile
RELEASE_NUMBER ?= 1\
VERSION ?= ""

all: build push

Expand All @@ -21,6 +23,8 @@ run: build
docker run --rm -it \
-v $(DIR_TO_TAIL):/tmp/host \
-v $(FLUENT_BIT_DB_DIR):/tailing-sidecar/var \
--build-arg RELEASE_NUMBER=$(RELEASE_NUMBER) \
--build-arg VERSION=$(VERSION) \
--env "PATH_TO_TAIL=/tmp/host/$(FILES_PATTERN)" \
--env "LOG_LEVEL=${LOG_LEVEL}" $(TAG)

Expand Down

0 comments on commit 3cf903d

Please sign in to comment.