forked from Venthe/Personal-Development-Pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manager.sh
94 lines (79 loc) · 2.58 KB
/
manager.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env bash
set -o pipefail
set -o errexit
. ./.env
list_tags() {
ansible-playbook ./provision-kubernetes.yml --list-tags
}
function provision() {
ansible-playbook \
./provision-kubernetes.yml \
--inventory-file ./kubernetes.inventory.yml \
--user ${PLAY_USERNAME} \
--ask-become \
"${@}"
}
function ansible_lint() {
local filename="${1}"
ansible-lint "${filename}"
}
function yaml_lint() {
local filename="${1}"
yamllint "${filename}"
}
function ansible_syntax_check() {
local filename="${1}"
ansible-playbook "${filename}" --syntax-check
}
function validate() {
files=$(find . -type f | grep -e yml -e yaml)
for file in $files; do
echo "${file}"
ansible_syntax_check "${file}"
done
}
function lint() {
function updateStatus() {
local newStatus=$1
if [[ $newStatus -gt 0 ]]; then
status=1
fi
}
files=$(find . -type f | grep -e yml -e yaml)
status=0
for file in $files; do
echo "${file}"
local filename="${1}"
ansible_lint "${filename}"
updateStatus $?
yaml_lint "${filename}"
updateStatus $?
done
exit $status
}
function download_all_helm() {
helm repo add argo https://argoproj.github.io/argo-helm
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add cert-utils-operator https://redhat-cop.github.io/cert-utils-operator
helm repo add cetic https://cetic.github.io/helm-charts
helm repo add coredns https://coredns.github.io/helm
helm repo add cowboysysop https://cowboysysop.github.io/charts/
helm repo add democratic-csi https://democratic-csi.github.io/charts/
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add hashicorp https://helm.releases.hashicorp.com
helm repo add helm-stable https://charts.helm.sh/stable
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo add jenkins https://charts.jenkins.io
helm repo add jetstack https://charts.jetstack.io
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
helm repo add loki https://grafana.github.io/loki/charts
helm repo add nexus https://nexus.home.arpa/repository/helm-hosted/
helm repo add opensearch https://opensearch-project.github.io/helm-charts
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add rook-release https://charts.rook.io/release
helm repo add sonatype https://sonatype.github.io/helm3-charts/
helm repo add stakater https://stakater.github.io/stakater-charts
helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts
helm repo update
}
${@}