forked from vegardlu/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.functions
161 lines (136 loc) · 3.95 KB
/
.functions
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
jasypt-encode() {
mvn jasypt:encrypt-value -Djasypt.encryptor.password="$1" -Djasypt.plugin.value="$2"
}
jasypt-encode-dev() {
jasypt-encode "dev-jasypt-encryptor-password" "$1"
}
# ICP Evry
icp-restricted-login() {
cloudctl login -u "$(contacts -Hml -f '%e')" -a https://icp-restricted.finods.com:8443
helm version
}
icp-global-login() {
cloudctl login -u "$(contacts -Hml -f '%e')" -a https://icp-global.finods.com:8443
helm version
}
icp-prod-login() {
cloudctl login -u "$(contacts -Hml -f '%e')" -a https://icp-prod.finods.com:8443
}
helm-upgrade-release() {
echo "----------------"
echo "Upgrading $1"
echo "----------------"
echo "- Namespace: $1"
echo "- Settings: $2"
echo "- Env-config: $3"
echo "- Version: $4"
echo "----------------"
helm upgrade "$1" evryfs/fsjetty --namespace "$1" -f "$2" --wait --reset-values --install --timeout 5m0s \
--debug --set-string image.tag="$4" --set-file 'configmap.application-envconfig\.yml'="$3"
}
helm-delete-release() {
echo "----------------"
echo "Are you sure you wish to delete $1?"
select yn in "Yes" "No"; do
case $yn in
Yes)
echo "----------------"
echo "Deleting $1"
echo "----------------"
helm delete "$1" --purge
break
;;
No)
break
;;
esac
done
}
helm-repo-add-evryfs() {
helm repo add evryfs https://fsdepot.evry.com/nexus/repository/evryfs-helm/
}
helm-upgrade-lad-bonus-g-d1() {
helm-upgrade-release \
"eos-lad-bonus-srv-d1" \
"$WORKSPACE/lad-bonus-srv/k8s/lad-bonus-g-d1.yaml" \
"$WORKSPACE/lad-bonus-srv/lad-bonus-config/src/main/resources/application-g-d1.yml" "$1"
}
helm-upgrade-lad-bonus-r-s2() {
helm-upgrade-release \
"eos-lad-bonus-srv-s2" \
"$WORKSPACE/lad-bonus-srv/k8s/lad-bonus-r-s2.yaml" \
"$WORKSPACE/lad-bonus-srv/lad-bonus-config/src/main/resources/application-r-s2.yml" "$1"
}
helm-upgrade-lad-dis-g-d1() {
helm-upgrade-release \
"eos-lad-dis-srv-d1" \
"$WORKSPACE/lad-dis-server/k8s/lad-dis-srv-g-d1.yaml" \
"$WORKSPACE/lad-dis-server/lad-dis-srv-config/src/main/resources/application-g-d1.yml" "$1"
}
helm-delete-lad-bonus-g-d1() {
helm-delete-release "eos-lad-bonus-srv-d1"
}
helm-delete-lad-bonus-r-s2() {
helm-delete-release "eos-lad-bonus-srv-s2"
}
helm-delete-lad-dis-g-d1() {
helm-delete-release "eos-lad-dis-srv-d1"
}
helm-delete-lad-dis-r-s2() {
helm-delete-release "eos-lad-dis-srv-s2"
}
helm-upgrade-cbt-account-g-d1() {
helm-upgrade-release \
"eos-cbt-account-srv-d1" \
"$WORKSPACE/cbt-account/k8s/cbt-account-g-d1.yaml" \
"$WORKSPACE/cbt-account/cbt-account-config/src/main/resources/application-g-d1.yml" "$1"
}
helm-upgrade-cbt-account-r-s2() {
helm-upgrade-release \
"eos-cbt-account-srv-s2" \
"$WORKSPACE/cbt-account/k8s/cbt-account-r-s2.yaml" \
"$WORKSPACE/cbt-account/cbt-account-config/src/main/resources/application-r-s2.yml" "$1"
}
helm-upgrade-lad-dis-r-s2() {
helm-upgrade-release \
"eos-lad-dis-srv-s2" \
"$WORKSPACE/lad-dis-server/k8s/lad-dis-srv-r-s2.yaml" \
"$WORKSPACE/lad-dis-server/lad-dis-srv-config/src/main/resources/application-r-s2.yml" "$1"
}
# Helm 2
helm2-init() {
eval $(cloudctl helm-init)
helm2 version --tls
}
helm2-icp-restricted-login() {
cloudctl login -u "$(contacts -Hml -f '%e')" -a https://icp-restricted.finods.com:8443
helm2-init
}
helm2-icp-global-login() {
cloudctl login -u "$(contacts -Hml -f '%e')" -a https://icp-global.finods.com:8443
helm2-init
}
helm2-delete-release() {
echo "----------------"
echo "Are you sure you wish to delete $1?"
select yn in "Yes" "No"; do
case $yn in
Yes)
echo "----------------"
echo "Deleting $1"
echo "----------------"
helm2 delete "$1" --purge --tls
break
;;
No)
break
;;
esac
done
}
helm2-delete-cbt-account-g-d1() {
helm-delete-release "eos-cbt-account-srv-d1"
}
helm2-delete-cbt-account-r-s2() {
helm-delete-release "eos-cbt-account-srv-s2"
}