Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add Golang-based deploy-cli #1669

Merged
merged 1 commit into from
Sep 16, 2024
Merged
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
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ KUSTOMIZE = tools/bin/kustomize
CONTROLLER_GEN = tools/bin/controller-gen
GINKGO = tools/bin/ginkgo
GINKGO_VER = v2.17.1
DEPLOY_CLI = tools/bin/deploy-cli

# See pkg/version.go for details
SOURCE_GIT_COMMIT ?= $(shell git rev-parse --short HEAD)
Expand Down Expand Up @@ -63,7 +64,6 @@ GOLANGCI_LINT_VER := v1.56.2
GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN))
GOLANGCI_LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint


# to set multiple ginkgo skip flags, if any
ifneq ($(strip $(GINKGO_SKIP)),)
_SKIP_ARGS := $(foreach arg,$(strip $(GINKGO_SKIP)),-skip="$(arg)")
Expand Down Expand Up @@ -193,6 +193,10 @@ $(CONTROLLER_GEN): hack/tools/go.mod
$(KUSTOMIZE): hack/tools/go.mod
cd hack/tools; go build -o $(abspath $@) sigs.k8s.io/kustomize/kustomize/v5

.PHONY: deploy-cli
deploy-cli:
cd hack/tools/deploy-cli; go build -o $(abspath $(DEPLOY_CLI))

.PHONY: build-e2e
build-e2e:
cd test; go build ./...
Expand Down
26 changes: 26 additions & 0 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@
This folder contains kustomizations for the Baremetal Operator. They have
traditionally been used through the [deploy.sh](../tools/deploy.sh) script,
which takes care of generating the necessary config for basic-auth and TLS.

tuminoid marked this conversation as resolved.
Show resolved Hide resolved
Experimentally, instead of `deploy.sh`, you can use the new golang-based
[deploy-cli](../hack/tools/deploy-cli) library,
which, at the moment, handles everything `deploy.sh` does. You can either:

- Run the package with `go run`. From the root of BMO repository:

```shell
cd hack/tools/deploy-cli
go run *.go
```

- Otherwise, build the package to a static binary:

```shell
make deploy-cli
```

And run the binary with:

```shell
./tools/bin/deploy-cli -h
```

To check which options are available, run the script/binary with `-h`.

However, a more GitOps friendly way would be to create your own static overlay.
Check the `overlays/e2e` for an example that is used in the e2e tests.
In the CI system we generate the necessary credentials before starting the test
Expand Down
1 change: 1 addition & 0 deletions hack/tools/deploy-cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deploy-cli
Loading