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 <drosiek@sumologic.com>
  • Loading branch information
Dominik Rosiek committed Feb 16, 2024
1 parent 34fc4ec commit 1995045
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
24 changes: 24 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
- 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
- name: Push tailing sidecar image with latest tag
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar
- name: Push tailing sidecar ubi image with latest tag
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar
- name: Log in to AWS Public ECR to publish tailing sidecar image
run: make login-ecr
env:
Expand All @@ -50,9 +56,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
- 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
- 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
- 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

build-operator:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -82,9 +94,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 @@ -93,9 +111,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
- 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
- name: Push tailing sidecar image with latest tag
run: make build-push-multiplatform TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar
- name: Push tailing sidecar ubi image with latest tag
run: make build-push-ubi TAG=${{ env.SIDECAR_IMAGE }}:${{ env.LATEST_TAG }}
working-directory: ./sidecar
- 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
- 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
- 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
- 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

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
7 changes: 6 additions & 1 deletion sidecar/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 ${root_dir}sidecar/Dockerfile ${root_dir}sidecar/
docker build --tag $(TAG) --file ${root_dir}sidecar/${DOCKERFILE} ${root_dir}sidecar/

run: build
docker run --rm -it \
Expand All @@ -28,6 +29,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 1995045

Please sign in to comment.