diff --git a/.gitignore b/.gitignore index 7d2a8e1d..ad17b105 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ gosec.sarif # from prepare-restricted-environment script catalog_mirror.log manifests-rhdh-index-* +rhdh-operator-*.yaml rhdh-disconnected-install/ rhdh-disconnected-install.Dockerfile diff --git a/Makefile b/Makefile index 65d051b5..ef4a5b50 100644 --- a/Makefile +++ b/Makefile @@ -401,3 +401,10 @@ show-img: show-container-engine: @echo -n $(CONTAINER_ENGINE) + +.PHONY: deployment-manifest +deployment-manifest: manifests kustomize ## Generate manifest to deploy operator. + cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) + $(KUSTOMIZE) build config/default > rhdh-operator-${VERSION}.yaml + @echo "Generated operator script rhdh-operator-${VERSION}.yaml" + diff --git a/docs/developer.md b/docs/developer.md index b1ec2db6..9b4da82f 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -54,7 +54,16 @@ make run - Or deploy the controller to the cluster with the image specified by `IMG`: ```sh -make deploy IMG=/backstage-operator:tag +make deploy [IMG=/backstage-operator:tag] +``` + +- To generate deployment manifest, use: +```sh +make deployment-manifest [IMG=/backstage-operator:tag] +``` +it will create the file rhdh-operator-${VERSION}.yaml on the project root and you will be able to share it to make it possible to deploy operator with: +```sh +kubectl apply -f ``` ### Uninstall CRDs @@ -102,3 +111,4 @@ make manifests **NOTE:** Run `make --help` for more information on all potential `make` targets More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) +