Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Set up Go
uses: actions/setup-go@v2
Expand All @@ -34,7 +34,7 @@ jobs:

unit:
name: Unit Test
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Set up Go
uses: actions/setup-go@v2
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:

build:
name: Build
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/heads/release-') }}
run: |
export BASE_VERSION=$(cat version.txt)
export VERSION=$BASE_VERSION-$(date +'%Y%m%d%H%M')
export VERSION=$BASE_VERSION-$(TARGETARCHdate +'%Y%m%d%H%M')
echo $VERSION > VERSION

- name: Build Images
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM --platform=${BUILDPLATFORM} golang:1.21 as builder
FROM --platform=linux/amd64 golang:1.21 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ OUTPUT_INSTALL_EXE_DIR := $(BUILD_DIR)/install-exe
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 3.0.1

OS ?= linux
ARCH ?= amd64
PLATFORM ?= ${OS}/${ARCH}

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
Expand Down Expand Up @@ -107,14 +111,14 @@ run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go

docker-build: ## Build docker image with the manager.
docker build -t ${IMG} .
docker build --platform=$(PLATFORM) -t ${IMG} .

docker-push: ## Push docker image with the manager.
docker push ${IMG}

.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
docker buildx build --push --platform=$(PLATFORMS) --tag $(IMG) .
docker buildx build --push --platform=$(PLATFORM) --tag $(IMG) .

##@ Deployment

Expand Down