Skip to content

Commit

Permalink
chore: update Makefiles and github actions
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Rosiek <[email protected]>
  • Loading branch information
Dominik Rosiek committed Feb 16, 2024
1 parent 0cfd597 commit 62f2dca
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/dev_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ jobs:
- name: Build and push tailing sidecar multiplatform image
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 }}
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 }}
working-directory: ./sidecar/fluentbit
- name: Log in to AWS Public ECR to publish tailing sidecar image
run: make login-ecr
env:
Expand All @@ -50,9 +56,16 @@ jobs:
- name: Build and push to ECR tailing sidecar multiplatform image
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 }}
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 }}
working-directory: ./sidecar/fluentbit


build-otelcol-sidecar:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -117,9 +130,15 @@ jobs:
- name: Build and push tailing sidecar operator multiplatform image
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 }}
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 }}
working-directory: ./operator
- name: Log in to AWS Public ECR to publish tailing sidecar operator image
run: make login-ecr
env:
Expand All @@ -128,9 +147,15 @@ jobs:
- name: Build and push to ECR tailing sidecar operator multiplatform image
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 }}
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 }}
working-directory: ./operator

push-helm-chart:
runs-on: ubuntu-20.04
Expand Down
26 changes: 25 additions & 1 deletion .github/workflows/release_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ jobs:
registry: ghcr.io
username: USERNAME
password: ${{ secrets.CR_PAT }}
- name: Push tailing sidecar image
- name: Build and push tailing sidecar multiplatform image
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 }}
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 }}
working-directory: ./sidecar/fluentbit
- name: Log in to AWS Public ECR to publish tailing sidecar image
run: make login-ecr
env:
Expand All @@ -49,9 +55,15 @@ jobs:
- name: Build and push to ECR tailing sidecar multiplatform image
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 }}
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 }}
working-directory: ./sidecar/fluentbit

build-operator:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -81,9 +93,15 @@ jobs:
- name: Build and push tailing sidecar operator multiplatform image
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 }}
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 }}
working-directory: ./operator
- name: Log in to AWS Public ECR to publish tailing sidecar operator image
run: make login-ecr
env:
Expand All @@ -92,9 +110,15 @@ jobs:
- name: Build and push to ECR tailing sidecar operator multiplatform image
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 }}
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 }}
working-directory: ./operator

push-helm-chart:
runs-on: ubuntu-20.04
Expand Down
7 changes: 6 additions & 1 deletion operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)

# Image URL to use all building/pushing image targets
IMG ?= localhost:32000/sumologic/tailing-sidecar-operator:latest
DOCKERFILE ?= Dockerfile

# Image URL for tailing sidecar
TAILING_SIDECAR_IMG ?= localhost:32000/sumologic/tailing-sidecar:latest
Expand Down Expand Up @@ -174,7 +175,7 @@ generate: controller-gen

# Build the docker image
docker-build:
docker build . -t ${IMG}
docker build . -f ${DOCKERFILE} -t ${IMG}

# Push the docker image
docker-push:
Expand All @@ -187,6 +188,10 @@ build-push-multiplatform:
--tag ${IMG} \
.

build-push-ubi:
$(MAKE) docker-build DOCKERFILE=${DOCKERFILE}.ubi IMG=${IMG}-ubi
$(MAKE) docker-push DOCKERFILE=${DOCKERFILE}.ubi IMG=${IMG}-ubi

# find or download controller-gen
# download controller-gen if necessary
controller-gen:
Expand Down
File renamed without changes.
7 changes: 6 additions & 1 deletion sidecar/fluentbit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
root_dir := $(dir $(abspath $(mkfile_path)/..))

TAG ?= "localhost:32000/sumologic/tailing-sidecar:latest"
DOCKERFILE ?= Dockerfile

all: build push

build:
docker build --tag $(TAG) --file Dockerfile .
docker build --tag $(TAG) --file ${DOCKERFILE} .

build-test-image: build

Expand All @@ -30,6 +31,10 @@ build-push-multiplatform:
--tag ${TAG} \
.

build-push-ubi:
$(MAKE) build DOCKERFILE=${DOCKERFILE}.ubi TAG=${TAG}-ubi
$(MAKE) push DOCKERFILE=${DOCKERFILE}.ubi TAG=${TAG}-ubi

push:
docker push $(TAG)

Expand Down

0 comments on commit 62f2dca

Please sign in to comment.