Skip to content

Commit

Permalink
auto-set version from git tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Scaffidi committed Oct 27, 2024
1 parent 8429744 commit 3e236db
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.0.5

# git tags should be of the format vX.Y.Z (semver-compliant)
GIT_TAG := $(shell git describe --tags)

# version to use inside bundles and catalog etc
VERSION ?= $(GIT_TAG:v%=%)

# tag to use for the docker image
IMG_TAG ?= v$(VERSION)

# in the OLM bundle, the operator version has to have the format X.Y.Z (semver-compliant)
#BUNDLE_OLM_VERSION := $(VERSION)

# 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")
Expand Down Expand Up @@ -50,7 +61,7 @@ endif
# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
OPERATOR_SDK_VERSION ?= v1.36.1
# Image URL to use all building/pushing image targets
IMG ?= $(IMAGE_TAG_BASE):$(VERSION)
IMG ?= $(IMAGE_TAG_BASE):$(IMG_TAG)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.29.0

Expand Down
8 changes: 4 additions & 4 deletions bundle/manifests/istio-fortsa.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ metadata:
annotations:
alm-examples: '[]'
capabilities: Basic Install
createdAt: "2024-10-27T14:59:27Z"
createdAt: "2024-10-27T21:24:58Z"
operators.operatorframework.io/builder: operator-sdk-v1.36.1
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
name: istio-fortsa.v0.0.5
name: istio-fortsa.v0.0.6
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -136,7 +136,7 @@ spec:
- --leader-elect
command:
- /manager
image: ghcr.io/hercynium/istio-fortsa:0.0.5
image: ghcr.io/hercynium/istio-fortsa:v0.0.6
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -219,4 +219,4 @@ spec:
minKubeVersion: 1.24.0
provider:
name: istio-fortsa
version: 0.0.5
version: 0.0.6
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: ghcr.io/hercynium/istio-fortsa
newTag: 0.0.5
newTag: v0.0.6

0 comments on commit 3e236db

Please sign in to comment.