Skip to content

Commit

Permalink
adapt module build to kyma API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
m00g3n committed Oct 5, 2023
1 parent 2ee331d commit d6caa70
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,26 @@ module-image: docker-build docker-push ## Build the Module Image and push it to
echo "built and pushed module image $(IMG)"

.PHONY: module-build
module-build: kyma kustomize ## Build the Module and push it to a registry defined in MODULE_REGISTRY
module-build: kyma kustomize module-config-template configure-git-origin ## Build the Module and push it to a registry defined in MODULE_REGISTRY
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
@$(KYMA) alpha create module --channel=${MODULE_CHANNEL} --name kyma-project.io/module/$(MODULE_NAME) --version $(MODULE_VERSION) --path . $(MODULE_CREATION_FLAGS) --output=moduletemplate.yaml --kubebuilder-project
@$(KYMA) alpha create module --path . --output=moduletemplate.yaml \
--module-config-file=module-config.yaml $(MODULE_CREATION_FLAGS)

.PHONY: module-config-template
module-config-template:
@cat module-config-template.yaml \
| sed -e 's/{{.Channel}}/${MODULE_CHANNEL}/g' \
-e 's/{{.Version}}/$(MODULE_VERSION)/g' \
-e 's/{{.Name}}/kyma-project.io\/module\/$(MODULE_NAME)/g' \
> module-config.yaml

.PHONY: configure-git-origin
configure-git-origin:
# test-infra does not include origin remote in the .git directory.
# the CLI is looking for the origin url in the .git dir so first we need to be sure it's not empty
@git remote | grep '^origin$$' -q || \
git remote add origin https://github.com/kyma-project/keda-manager


##@ Tools

Expand Down
9 changes: 9 additions & 0 deletions module-config-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: {{.Name}}
channel: {{.Channel}}
version: {{.Version}}
defaultCR: config/samples/operator_v1alpha1_applicationconnector.yaml
manifest: application-connector-manager.yaml
security: sec-scanners-config.yaml
annotations:
"operator.kyma-project.io/doc-url": "https://kyma-project.io/#/application-connector-manager/user/README"
moduleRepo: https://github.com/kyma-project/application-connector-manager.git

0 comments on commit d6caa70

Please sign in to comment.