From 0b6ecb03f51c6a8b7fdb03dc51e44a5ae3a85412 Mon Sep 17 00:00:00 2001 From: Joshua B Date: Fri, 30 Jul 2021 23:18:19 -0600 Subject: [PATCH] feat: make env unde db consistent with app (#9) --- bin/docmark | 2 +- bin/init_env | 6 ------ makefiles/docmark.make | 6 ++++-- makefiles/kubectl-config.make | 7 +++++++ makefiles/secrets.make | 4 +++- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/bin/docmark b/bin/docmark index 50bda07..0a2795d 100755 --- a/bin/docmark +++ b/bin/docmark @@ -42,7 +42,7 @@ function docmark.shell { docker.start "$DOCMARK_DOCKER_NAME" --rm -it \ --entrypoint /bin/bash \ -p 8000:8000 \ - -v "$(pwd)":/project:delegated \ + -v "$(pwd)":/project \ -e GITHUB_TOKEN="${GITHUB_TOKEN}" \ "$DOCMARK_DOCKER_IMAGE" diff --git a/bin/init_env b/bin/init_env index eaa191a..5a9e66c 100755 --- a/bin/init_env +++ b/bin/init_env @@ -148,8 +148,6 @@ function circle_init_env { fi } - - # if it has a DBMS then this kicks in the db related variables function init_db_env { if [ ! "${DBMS:-}" ]; then @@ -158,10 +156,6 @@ function init_db_env { # arg $1 must always be the database, defaults to mysql if nothing specified setVar DBMS "$DBMS" setVar DOCK_DB_BUILD_NAME "$DBMS-build" - : "${DB_VERSION:=$VERSIONX}" - : "${DOCKER_DB_REPO:=dock9/nine-db}" - : "${DOCKER_DB_TAG:=${DBMS}-${DB_VERSION}}" - setVar DOCKER_DB_URL "$DOCKER_DB_REPO:$DOCKER_DB_TAG" # **** DB Vars (MYSQL by default) **** setVar DB_HOST 127.0.0.1 diff --git a/makefiles/docmark.make b/makefiles/docmark.make index c2e8ec2..27a0ca5 100644 --- a/makefiles/docmark.make +++ b/makefiles/docmark.make @@ -10,8 +10,10 @@ GROOVYDOC_BUILD_DIR ?= $(BUILD_DIR)/docs/groovydoc # --- Dockers --- ## serves the docmark docs from docker, alias to docker.dockmark-up -docmark.start: | _verify-DOCKER_CMD - make docker.dockmark-$(DOCKER_CMD) +docmark.start: docker.dockmark-up + +## serves the docmark docs from docker, alias to docker.dockmark-up +docmark.shell: docker.dockmark-shell ## docker for docmark docs, follow with a docker cmd up, down, shell or pull docker.dockmark: | _verify-DOCKER_CMD diff --git a/makefiles/kubectl-config.make b/makefiles/kubectl-config.make index f96b117..5c11679 100644 --- a/makefiles/kubectl-config.make +++ b/makefiles/kubectl-config.make @@ -12,3 +12,10 @@ kubectl.config: | _verify_K8_SERVER _verify_K8_USER _verify_K8_TOKEN echo "$@ success" .PHONY: kubectl.config + +kubectl.get-contexts: + kubectl config get-contexts + +kubectl.use-context.%: + kubectl config use-context $* + diff --git a/makefiles/secrets.make b/makefiles/secrets.make index 5d4ba75..aaab960 100644 --- a/makefiles/secrets.make +++ b/makefiles/secrets.make @@ -11,7 +11,7 @@ $(GIT_SECRET_SH): cd $(SHIPKIT_INSTALLS)/git-secret && make build secrets.decrypt-vault: secrets.import-gpg-key $(GIT_SECRET_SH) | _verify_VAULT_URL _verify_GPG_PASS - @[ ! -e $(VAULT_DIR) ] && git clone $(VAULT_URL) $(VAULT_DIR) || :; + [ ! -e $(VAULT_DIR) ] && git clone $(VAULT_URL) $(VAULT_DIR) || :; cd build/vault && $(GIT_SECRET_SH) reveal -p "$(GPG_PASS)" secrets.import-gpg-key: | _verify_BOT_EMAIL @@ -36,6 +36,8 @@ secrets.help: echo "$(ccyan)secrets.list $(cnormal)| list files and authorized users" echo "$(ccyan)secrets.clean $(cnormal)| removes all the hidden files" echo + echo -e "${cbold}If using a gir repo as a vault linked the VAULT_URL variable then\n" + echo "$(ccyan)secrets.decrypt-vault $(cnormal)| clone in VAULT_DIR and decrypt/reveal. bot.env here is used in other shipkit scripts" # Shows the git-secret version secrets.show-version: $(GIT_SECRET_SH)