Skip to content

Commit

Permalink
Add Golang-based deploy-cli which handles bmo and ironic deployments
Browse files Browse the repository at this point in the history
Signed-off-by: Max Rantil <max.rantil@est.tech>

Signed-off-by: Huy Mai <huy.mai@est.tech>
  • Loading branch information
Max Rantil authored and mquhuy committed Aug 9, 2024
1 parent b814056 commit 9cd23ab
Show file tree
Hide file tree
Showing 14 changed files with 1,034 additions and 57 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
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 ../../../tools/bin/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.

Experimentally, in `deploy.sh` stead, 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`:

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

- Otherwise, build the package to a static binary:

```shell
cd $BMO_ROOT
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

0 comments on commit 9cd23ab

Please sign in to comment.