@./bin/$(GONAME) binary --bin_path ${BINDIR} --installer_repository ${INSTALLER_GIT_REPO} --installer_tag ${INSTALLER_GIT_TAG}
build:
- @echo "Building knictl with $(GOPATH) to ./bin"
- @GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -o bin/$(GONAME) $(GOFILES)
+ @echo "Building knictl with $(GOPATH) to knictl.tar.gz"
+ @GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -o $(GONAME) $(GOFILES)
+ tar -czvf knictl.tar.gz $(GONAME) plugins utils
clean:
@echo "Destroying previous cluster"
--- /dev/null
+#!/bin/bash
+
+# This is a simple kustomize transformer plugin that allows
+# injecting configuration for a site into the blueprint.
+# It's current purpose is to inject the pull secret and ssh public key
+# into the site config such that it doesn't have to be stored in git iwth the
+# blueprint. Instead, it's taken from the WORK_DIR (but could eventually be
+# retrieved from a k8s secret or a vault instead).
+# The same mechanism could be used in the future to template in more site
+# configuration parameters for which a purist "kustomization" is too cumbersome.
+
+# set -x
+set -e
+
+# Skip the config file name argument.
+shift
+
+PULL_SECRET=$(cat ${HOME}/.kni/pull-secret.json)
+SSH_PUB_KEY=$(cat ${HOME}/.kni/id_rsa.pub)
+
+cat - | sed \
+ -e "s|PULL_SECRET|\'${PULL_SECRET}\'|" \
+ -e "s|SSH_PUB_KEY|${SSH_PUB_KEY}|"
\ No newline at end of file