-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from carlosrodlop/feat-brach
[Helmfile, SDA] Using CB, CI Makefiles from SDA
- Loading branch information
Showing
4 changed files
with
79 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,23 @@ | ||
MKFILE := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) | ||
CI_MAKEFOLDER := $(MKFILE)/../cbci | ||
CD_MAKEFOLDER := $(MKFILE)/../cbcd | ||
PARENT_MKFILE := $(HOME)/.Makefile | ||
DIR_HELMFILES := $(MKFILE)/../../helmfile | ||
HELM_LOG_PATH := $(MKFILE)/helm.log | ||
|
||
include $(PARENT_MKFILE) | ||
|
||
define postHelmDelete | ||
helm repo remove cloudbees || echo "Repository cloudbees does not exist" | ||
kubectl delete --all pvc --grace-period=0 --force --namespace "cbci" | ||
kubectl delete --all pvc --grace-period=0 --force --namespace "cbcd" | ||
kubectl delete ns "cbci-agents" || echo "There is NOT existing namespace cbci-agents" | ||
kubectl delete ns "cbci" || echo "There is not existing namespace cbci" | ||
kubectl delete ns "cbcd" || echo "There is not existing namespace cbcd" | ||
endef | ||
|
||
.PHONY: helmfile-update | ||
helmfile-update: ## Install/Update CloudBees Core Modern via Helmfile. | ||
helmfile-update: check_kubeconfig | ||
helmfile-update: | ||
@rm -f $(HELM_LOG_PATH) | ||
cd $(CD_MAKEFOLDER) && make cdCreateDBRemotely | ||
helmfile --debug --file $(DIR_HELMFILES)/sda.eks.alb.helmfile.yml --interactive apply | tee -a $(HELM_LOG_PATH) | ||
|
||
.PHONY: purge_pods | ||
purge_pods: | ||
purge_pods: #Purge Pods in cbci and cbci-agents namespaces | ||
kubectl delete --all pods --grace-period=0 --force --namespace "cbcd" | ||
kubectl delete --all pods --grace-period=0 --force --namespace "cbci" | ||
kubectl delete --all pods --grace-period=0 --force --namespace "cbci-agents" | ||
|
||
.PHONY: helmfile-delete | ||
helmfile-delete: ## Helmfile Delete | ||
helmfile-delete: check_kubeconfig purge_pods | ||
helmfile-delete: check_kubeconfig | ||
@rm -f $(HELM_LOG_PATH) | ||
cd $(CI_MAKEFOLDER) && make ciHelm-delete | ||
cd $(CD_MAKEFOLDER) && make cdDeleteAllDBRemote | ||
helmfile --debug --file $(DIR_HELMFILES)/sda.eks.alb.helmfile.yml destroy | tee -a $(HELM_LOG_PATH) | ||
$(call postHelmDelete) |