@leverege/build-tools 2.15.0 → 2.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/server/overwhelm.js +13 -0
- package/lib/server/repo-init/config.tgz +0 -0
- package/lib/web/overwhelm.js +13 -0
- package/package.json +3 -3
- package/src/dockreate +1 -0
- package/src/helmup +67 -10
- package/src/overwhelm.js +7 -0
package/lib/server/overwhelm.js
CHANGED
|
@@ -110,6 +110,14 @@ if (!fs.existsSync('overwhelm.yaml')) {
|
|
|
110
110
|
|
|
111
111
|
const yaml = YAML.load(fs.readFileSync('overwhelm.yaml', 'utf-8'));
|
|
112
112
|
const over = yaml.default;
|
|
113
|
+
|
|
114
|
+
if (process.env.OVERWHELM_DEBUG) {
|
|
115
|
+
console.log({
|
|
116
|
+
over,
|
|
117
|
+
yaml
|
|
118
|
+
}, '<==Contents of the over and yaml structs');
|
|
119
|
+
}
|
|
120
|
+
|
|
113
121
|
let cfgs = yaml[context]; // If we just need to check context return 0 if cfgs exists, else error.
|
|
114
122
|
|
|
115
123
|
if (args.checkctx) {
|
|
@@ -342,6 +350,11 @@ glob.sync('**/*.ovh').forEach(cfgmap => {
|
|
|
342
350
|
}); // Set the GCP context for safety!
|
|
343
351
|
|
|
344
352
|
const clusterName = over.CLUSTER_NAME;
|
|
353
|
+
|
|
354
|
+
if (over.PROJECT_NAME === 'minikube') {
|
|
355
|
+
process.exit(0);
|
|
356
|
+
}
|
|
357
|
+
|
|
345
358
|
const projectId = over.PROJECT_ID;
|
|
346
359
|
let zone = over['GCE_REGION'] + (over['GCE_ZONE'] ? `-${over['GCE_ZONE']}` : '');
|
|
347
360
|
|
|
Binary file
|
package/lib/web/overwhelm.js
CHANGED
|
@@ -110,6 +110,14 @@ if (!fs.existsSync('overwhelm.yaml')) {
|
|
|
110
110
|
|
|
111
111
|
const yaml = YAML.load(fs.readFileSync('overwhelm.yaml', 'utf-8'));
|
|
112
112
|
const over = yaml.default;
|
|
113
|
+
|
|
114
|
+
if (process.env.OVERWHELM_DEBUG) {
|
|
115
|
+
console.log({
|
|
116
|
+
over,
|
|
117
|
+
yaml
|
|
118
|
+
}, '<==Contents of the over and yaml structs');
|
|
119
|
+
}
|
|
120
|
+
|
|
113
121
|
let cfgs = yaml[context]; // If we just need to check context return 0 if cfgs exists, else error.
|
|
114
122
|
|
|
115
123
|
if (args.checkctx) {
|
|
@@ -342,6 +350,11 @@ glob.sync('**/*.ovh').forEach(cfgmap => {
|
|
|
342
350
|
}); // Set the GCP context for safety!
|
|
343
351
|
|
|
344
352
|
const clusterName = over.CLUSTER_NAME;
|
|
353
|
+
|
|
354
|
+
if (over.PROJECT_NAME === 'minikube') {
|
|
355
|
+
process.exit(0);
|
|
356
|
+
}
|
|
357
|
+
|
|
345
358
|
const projectId = over.PROJECT_ID;
|
|
346
359
|
let zone = over['GCE_REGION'] + (over['GCE_ZONE'] ? `-${over['GCE_ZONE']}` : '');
|
|
347
360
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.1",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"parse-gitignore": "^1.0.1",
|
|
69
69
|
"readline-sync": "^1.4.10",
|
|
70
70
|
"semver": "^7.3.7",
|
|
71
|
-
"simple-git": "^3.
|
|
71
|
+
"simple-git": "^3.10.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/cli": "^7.17.10",
|
|
@@ -76,6 +76,6 @@
|
|
|
76
76
|
"@babel/node": "^7.18.5",
|
|
77
77
|
"@leverege/babel-preset-leverege-node": "^2.0.0",
|
|
78
78
|
"@leverege/eslint-config-leverege": "^3.0.1",
|
|
79
|
-
"npm": "^8.
|
|
79
|
+
"npm": "^8.13.1"
|
|
80
80
|
}
|
|
81
81
|
}
|
package/src/dockreate
CHANGED
|
@@ -44,6 +44,7 @@ pluginFile="Dockerfile.plugin"
|
|
|
44
44
|
|
|
45
45
|
# cleanup trapper for gracefully killing, which doesn't do much right now
|
|
46
46
|
cleanup() {
|
|
47
|
+
[ ! -z "$DOCKER_SKIP_CLEANUP" ] && printf "\nSkipping clean up\n\n" && exit 1
|
|
47
48
|
printf "\nCleaning up and exiting...\n\n"
|
|
48
49
|
rm -rf ./workspace $SSHDIR .npmrc
|
|
49
50
|
exit 0
|
package/src/helmup
CHANGED
|
@@ -44,7 +44,7 @@ SYSTEM=(
|
|
|
44
44
|
|
|
45
45
|
# support for legacy bitnami charts
|
|
46
46
|
function addBitnamiRepo() {
|
|
47
|
-
if [ ! -z "$BITNAMI_LATEST" ];
|
|
47
|
+
if [ ! -z "$BITNAMI_LATEST" ] || [ "$1" == "latest" ];
|
|
48
48
|
then
|
|
49
49
|
BITNAMI_URL="https://charts.bitnami.com/bitnami"
|
|
50
50
|
else
|
|
@@ -149,6 +149,69 @@ function installPrometheus() {
|
|
|
149
149
|
# removeHelmRepo prometheus-community
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
function installRedis() {
|
|
153
|
+
showInstalling "Redis Network Cache"
|
|
154
|
+
addBitnamiRepo latest
|
|
155
|
+
[ -z "$REDIS_HELM_CHART" ] && REDIS_HELM_CHART="16" # latest breaks us => "v14+"
|
|
156
|
+
helm upgrade --install redis bitnami/redis \
|
|
157
|
+
--version $REDIS_HELM_CHART \
|
|
158
|
+
-f - <<REDIS_CHART_MODS
|
|
159
|
+
auth:
|
|
160
|
+
enabled: false
|
|
161
|
+
|
|
162
|
+
global:
|
|
163
|
+
storageClass: ssd
|
|
164
|
+
|
|
165
|
+
metrics:
|
|
166
|
+
enabled: true
|
|
167
|
+
|
|
168
|
+
networkPolicy:
|
|
169
|
+
enabled: true
|
|
170
|
+
|
|
171
|
+
master:
|
|
172
|
+
persistence:
|
|
173
|
+
size: 8Gi # 8Gi is default
|
|
174
|
+
|
|
175
|
+
tolerations:
|
|
176
|
+
- key: "database"
|
|
177
|
+
operator: "Equal"
|
|
178
|
+
value: "true"
|
|
179
|
+
effect: "NoSchedule"
|
|
180
|
+
|
|
181
|
+
affinity:
|
|
182
|
+
nodeAffinity:
|
|
183
|
+
requiredDuringSchedulingIgnoredDuringExecution:
|
|
184
|
+
nodeSelectorTerms:
|
|
185
|
+
- matchExpressions:
|
|
186
|
+
- key: target-env
|
|
187
|
+
operator: In
|
|
188
|
+
values:
|
|
189
|
+
- database
|
|
190
|
+
|
|
191
|
+
replica:
|
|
192
|
+
persistence:
|
|
193
|
+
size: 8Gi # 8Gi is default
|
|
194
|
+
|
|
195
|
+
tolerations:
|
|
196
|
+
- key: "database"
|
|
197
|
+
operator: "Equal"
|
|
198
|
+
value: "true"
|
|
199
|
+
effect: "NoSchedule"
|
|
200
|
+
|
|
201
|
+
affinity:
|
|
202
|
+
nodeAffinity:
|
|
203
|
+
requiredDuringSchedulingIgnoredDuringExecution:
|
|
204
|
+
nodeSelectorTerms:
|
|
205
|
+
- matchExpressions:
|
|
206
|
+
- key: target-env
|
|
207
|
+
operator: In
|
|
208
|
+
values:
|
|
209
|
+
- database
|
|
210
|
+
REDIS_CHART_MODS
|
|
211
|
+
printf "\n\nTo start a specific version => `color g 'REDIS_HELM_CHART="13.0.1" helmup redis'`\n\n"
|
|
212
|
+
removeHelmRepo bitnami
|
|
213
|
+
}
|
|
214
|
+
|
|
152
215
|
function installMonitoringCharts(){
|
|
153
216
|
showInstalling "Monitoring Components"
|
|
154
217
|
createNamespaceIfNeeded monitoring
|
|
@@ -326,6 +389,8 @@ function installPreemptibleKiller() {
|
|
|
326
389
|
printf "\nCreating the gcloud $SVC_ACCT service account (SA)\n"
|
|
327
390
|
gcloud iam service-accounts create $SVC_ACCT \
|
|
328
391
|
--project $PROJECT_ID \
|
|
392
|
+
--description "Estafette Node Killer SA" \
|
|
393
|
+
--display-name "Estafette Node Killer SA"
|
|
329
394
|
warnOnError $? "SA creation may have failed or it already exists"
|
|
330
395
|
|
|
331
396
|
printf "\nCreate the $SVC_ACCT IAM role\n"
|
|
@@ -836,15 +901,7 @@ function doInstall() {
|
|
|
836
901
|
;;
|
|
837
902
|
|
|
838
903
|
"redis")
|
|
839
|
-
|
|
840
|
-
addBitnamiRepo
|
|
841
|
-
[ -z "$REDIS_HELM_CHART" ] && REDIS_HELM_CHART="13.0.1" # latest breaks us => "v14+"
|
|
842
|
-
helm upgrade --install redis bitnami/redis \
|
|
843
|
-
-f redis/redis-values.yaml \
|
|
844
|
-
--set auth.enabled=false \
|
|
845
|
-
--version $REDIS_HELM_CHART
|
|
846
|
-
printf "\n\nTo start a specific version => `color g 'REDIS_HELM_CHART="13.0.1" helmup redis'`\n\n"
|
|
847
|
-
removeHelmRepo bitnami
|
|
904
|
+
installRedis
|
|
848
905
|
;;
|
|
849
906
|
|
|
850
907
|
"reloader")
|
package/src/overwhelm.js
CHANGED
|
@@ -64,6 +64,10 @@ if ( !fs.existsSync( 'overwhelm.yaml' ) ) {
|
|
|
64
64
|
//
|
|
65
65
|
const yaml = YAML.load( fs.readFileSync( 'overwhelm.yaml', 'utf-8' ) )
|
|
66
66
|
const over = yaml.default
|
|
67
|
+
if ( process.env.OVERWHELM_DEBUG ) {
|
|
68
|
+
console.log( { over, yaml }, '<==Contents of the over and yaml structs' )
|
|
69
|
+
}
|
|
70
|
+
|
|
67
71
|
let cfgs = yaml[context]
|
|
68
72
|
|
|
69
73
|
// If we just need to check context return 0 if cfgs exists, else error.
|
|
@@ -286,6 +290,9 @@ glob.sync( '**/*.ovh' ).forEach( ( cfgmap ) => {
|
|
|
286
290
|
|
|
287
291
|
// Set the GCP context for safety!
|
|
288
292
|
const clusterName = over.CLUSTER_NAME
|
|
293
|
+
if ( over.PROJECT_NAME === 'minikube' ) {
|
|
294
|
+
process.exit(0)
|
|
295
|
+
}
|
|
289
296
|
const projectId = over.PROJECT_ID
|
|
290
297
|
let zone = over['GCE_REGION'] + ( over['GCE_ZONE'] ? `-${over['GCE_ZONE']}` : '' )
|
|
291
298
|
|