@leverege/build-tools 2.11.5 → 2.12.0-john.2
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/repo-init/config.tgz +0 -0
- package/package.json +10 -10
- package/src/dockreate +35 -8
- package/src/helmup +24 -7
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0-john.2",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"chalk": "^4.1.2",
|
|
52
52
|
"clipboardy": "^2.3.0",
|
|
53
53
|
"command-line-args": "^5.2.1",
|
|
54
|
-
"command-line-usage": "^6.1.
|
|
54
|
+
"command-line-usage": "^6.1.3",
|
|
55
55
|
"deepmerge": "^4.2.2",
|
|
56
|
-
"dotenv": "^16.0.
|
|
56
|
+
"dotenv": "^16.0.1",
|
|
57
57
|
"execa": "^5.1.1",
|
|
58
58
|
"figlet": "^1.5.2",
|
|
59
59
|
"glob": "^7.2.0",
|
|
60
|
-
"inquirer": "^8.2.
|
|
60
|
+
"inquirer": "^8.2.4",
|
|
61
61
|
"js-yaml": "^4.1.0",
|
|
62
62
|
"ncp": "^2.0.0",
|
|
63
63
|
"npm-registry-fetch": "^11.0.0",
|
|
@@ -65,15 +65,15 @@
|
|
|
65
65
|
"ora": "^5.4.1",
|
|
66
66
|
"parse-gitignore": "^1.0.1",
|
|
67
67
|
"readline-sync": "^1.4.10",
|
|
68
|
-
"semver": "^7.3.
|
|
69
|
-
"simple-git": "^3.
|
|
68
|
+
"semver": "^7.3.7",
|
|
69
|
+
"simple-git": "^3.7.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@babel/cli": "^7.17.
|
|
73
|
-
"@babel/core": "^7.17.
|
|
74
|
-
"@babel/node": "^7.
|
|
72
|
+
"@babel/cli": "^7.17.10",
|
|
73
|
+
"@babel/core": "^7.17.10",
|
|
74
|
+
"@babel/node": "^7.17.10",
|
|
75
75
|
"@leverege/babel-preset-leverege-node": "^2.0.0",
|
|
76
76
|
"@leverege/eslint-config-leverege": "^3.0.1",
|
|
77
|
-
"npm": "^8.
|
|
77
|
+
"npm": "^8.9.0"
|
|
78
78
|
}
|
|
79
79
|
}
|
package/src/dockreate
CHANGED
|
@@ -4,6 +4,25 @@ if [ -z "$1" ]; then
|
|
|
4
4
|
exit 1
|
|
5
5
|
fi
|
|
6
6
|
|
|
7
|
+
# Load common bash functions
|
|
8
|
+
. `build-tools --bashfun`
|
|
9
|
+
GITTOP=`git rev-parse --show-toplevel`
|
|
10
|
+
|
|
11
|
+
if [ ! -x "$(command -v jq)" ];
|
|
12
|
+
then
|
|
13
|
+
cat<<NO_JQ
|
|
14
|
+
|
|
15
|
+
`color r "***ERROR: Missing jq JSON processor"` => `color g 'brew install jq'`
|
|
16
|
+
|
|
17
|
+
NO_JQ
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
function packageJson() {
|
|
22
|
+
result=$(jq -r $1 $GITTOP/package.json)
|
|
23
|
+
[ "$result" != "null" ] && echo $result
|
|
24
|
+
}
|
|
25
|
+
|
|
7
26
|
# Global Vars
|
|
8
27
|
pluginFile="Dockerfile.plugin"
|
|
9
28
|
|
|
@@ -111,7 +130,7 @@ COPY --chown=node:node --from=intermediate /usr/src/app /usr/src/app
|
|
|
111
130
|
|
|
112
131
|
USER ${runuser}
|
|
113
132
|
COPY ./bashrc /home/node/.bashrc
|
|
114
|
-
CMD [ "/bin/bash", "-c", "node index.js" ]
|
|
133
|
+
CMD [ "/bin/bash", "-c", "node ${nodeops} index.js" ]
|
|
115
134
|
EODOCKER
|
|
116
135
|
} # end of create_Dockerfile
|
|
117
136
|
|
|
@@ -133,10 +152,11 @@ alias menv='env | sort | less'
|
|
|
133
152
|
|
|
134
153
|
alias whatsmyip='wget -qO- ifconfig.co'
|
|
135
154
|
|
|
136
|
-
alias dbg='wget -q -O- localhost:5111/logLevel/debug'
|
|
137
|
-
alias inf='wget -q -O- localhost:5111/logLevel/info'
|
|
138
155
|
alias err='wget -q -O- localhost:5111/logLevel/error'
|
|
139
156
|
alias wrn='wget -q -O- localhost:5111/logLevel/warn'
|
|
157
|
+
alias inf='wget -q -O- localhost:5111/logLevel/info'
|
|
158
|
+
alias dbg='wget -q -O- localhost:5111/logLevel/debug'
|
|
159
|
+
alias trc='wget -q -O- localhost:5111/logLevel/trace'
|
|
140
160
|
|
|
141
161
|
cmetrics()
|
|
142
162
|
{
|
|
@@ -174,7 +194,7 @@ ROTOKEN
|
|
|
174
194
|
fi
|
|
175
195
|
|
|
176
196
|
# Look for leverege specifics, but only require the project name.
|
|
177
|
-
project=$(
|
|
197
|
+
project=$(packageJson .leverege.project)
|
|
178
198
|
if [ "$project" == "" ];
|
|
179
199
|
then
|
|
180
200
|
cat<<NOPROJ
|
|
@@ -193,10 +213,12 @@ NOPROJ
|
|
|
193
213
|
exit 1
|
|
194
214
|
fi
|
|
195
215
|
|
|
196
|
-
|
|
216
|
+
# TODO: these should be combined into one require
|
|
217
|
+
nodeimg=$(packageJson '.leverege.nodeimg')
|
|
197
218
|
nodeimg="${nodeimg:-gallium-alpine}"
|
|
198
|
-
|
|
199
|
-
|
|
219
|
+
nodeops=$(packageJson '.leverege.nodeops')
|
|
220
|
+
apkadds=$(packageJson '.leverege.apkadds')
|
|
221
|
+
runuser=$(packageJson '.leverege.runuser')
|
|
200
222
|
[ -z "${runuser}" ] && runuser='node'
|
|
201
223
|
|
|
202
224
|
npmlogging='--silent' # allow for verbose npm logs
|
|
@@ -224,6 +246,8 @@ NOCONTAINER
|
|
|
224
246
|
container=$(basename $gitremote .git)
|
|
225
247
|
fi
|
|
226
248
|
gcimage=gcr.io/$project/$container
|
|
249
|
+
artifactory=us-docker.pkg.dev/leverege-registry/artifactory
|
|
250
|
+
registry=$artifactory/$container/images
|
|
227
251
|
|
|
228
252
|
version=$1
|
|
229
253
|
[[ -f '.previous' ]] && previous=`cat .previous` || previous='FIRST BUILD'
|
|
@@ -289,10 +313,11 @@ pluggedIn=$(colorize 'green' "no")
|
|
|
289
313
|
[ -f "${pluginFile}" ] && pluggedIn=$(colorize 'yellow' "YES")
|
|
290
314
|
|
|
291
315
|
cat<<IMGINFO
|
|
292
|
-
|
|
316
|
+
LOCAL LOCAL LOCAL
|
|
293
317
|
Project: $(colorize 'green' "$project")
|
|
294
318
|
Container: $(colorize 'green' "$container")
|
|
295
319
|
NodeImage: $(colorize 'green' "$nodeimg")
|
|
320
|
+
NopeOps: $(colorize 'yellow' "$nodeops")
|
|
296
321
|
NPM Logs: $(colorize 'green' "$npmlogging")
|
|
297
322
|
AddedPkgs: $(colorize 'green' "$apkadds")
|
|
298
323
|
PluggedIn: ${pluggedIn}
|
|
@@ -301,6 +326,7 @@ cat<<IMGINFO
|
|
|
301
326
|
Previous: $(colorize 'yellow' "$previous")
|
|
302
327
|
DateStamp: $(colorize 'green' "$pckgdts")
|
|
303
328
|
GCImage: $(colorize 'green' "$gcimage:$version")
|
|
329
|
+
Registry: $(colorize 'yellow' "$registry:$version")
|
|
304
330
|
|
|
305
331
|
IMGINFO
|
|
306
332
|
|
|
@@ -372,6 +398,7 @@ fi
|
|
|
372
398
|
|
|
373
399
|
# Tag the container with the node detailsand the culprit.
|
|
374
400
|
gcloud container images add-tag --quiet $gcimage:$version $gcimage:$pckgdts-$nodeimg-$USER
|
|
401
|
+
[ "$USE_ARTIFACTORY" == "yes" ] && gcloud container images add-tag --quiet $gcimage:$version $registry:$version &
|
|
375
402
|
|
|
376
403
|
if [ $tagging ];
|
|
377
404
|
then
|
package/src/helmup
CHANGED
|
@@ -164,8 +164,7 @@ SA_EXISTS
|
|
|
164
164
|
helm upgrade --install grafana grafana/grafana \
|
|
165
165
|
--namespace monitoring \
|
|
166
166
|
--values grafana/values-grafana.yaml \
|
|
167
|
-
|
|
168
|
-
--version 6.21 # latest v8 grafana
|
|
167
|
+
--version 6.26.5 # latest v8 grafana
|
|
169
168
|
}
|
|
170
169
|
|
|
171
170
|
function monitoringHelp(){
|
|
@@ -275,6 +274,8 @@ function installPreemptibleKiller() {
|
|
|
275
274
|
}
|
|
276
275
|
|
|
277
276
|
function installCronZombieKiller() {
|
|
277
|
+
local BATCH_SYNTAX='batch/v1' # GKE 1.21 and beyond
|
|
278
|
+
[ ! -z "$PRE_GKE_21" ] && BATCH_SYNTAX='batch/v1beta1'
|
|
278
279
|
cat<<END_OF_ZOMBIE | kubectl apply -f -
|
|
279
280
|
apiVersion: v1
|
|
280
281
|
kind: ServiceAccount
|
|
@@ -306,7 +307,7 @@ roleRef:
|
|
|
306
307
|
name: pod-accessor-role
|
|
307
308
|
apiGroup: ""
|
|
308
309
|
---
|
|
309
|
-
apiVersion:
|
|
310
|
+
apiVersion: $BATCH_SYNTAX
|
|
310
311
|
kind: CronJob
|
|
311
312
|
metadata:
|
|
312
313
|
namespace: default
|
|
@@ -334,6 +335,19 @@ spec:
|
|
|
334
335
|
- "echo Zombie Hunting `date` ; kubectl get pods -n default --field-selector='status.phase==Failed' -o name | xargs kubectl delete -n default 2> /dev/null"
|
|
335
336
|
status: {}
|
|
336
337
|
END_OF_ZOMBIE
|
|
338
|
+
|
|
339
|
+
if [[ $? -eq 1 ]];
|
|
340
|
+
then
|
|
341
|
+
cat<<OLDER_GKE
|
|
342
|
+
|
|
343
|
+
Deployment failed is the GKE version pre 1.21? Try rerunning with PRE_GKE_21 defined:
|
|
344
|
+
|
|
345
|
+
$ `color y "PRE_GKE_21=1 helmup zombie-killer"`
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
OLDER_GKE
|
|
349
|
+
exit 1
|
|
350
|
+
fi
|
|
337
351
|
}
|
|
338
352
|
|
|
339
353
|
function installCertManager() {
|
|
@@ -680,6 +694,10 @@ function doInstall() {
|
|
|
680
694
|
--set volumeClaimTemplate.storageClassName="ssd"
|
|
681
695
|
;;
|
|
682
696
|
|
|
697
|
+
"estafette"|"preemptible-killer")
|
|
698
|
+
installPreemptibleKiller # the gke preemptible node spreader outer
|
|
699
|
+
;;
|
|
700
|
+
|
|
683
701
|
"monitoring")
|
|
684
702
|
installMonitoringCharts
|
|
685
703
|
monitoringHelp
|
|
@@ -695,10 +713,6 @@ function doInstall() {
|
|
|
695
713
|
helm upgrade --install postgres bitnami/postgresql -f postgres/postgres-values.yaml --version 8.9.6
|
|
696
714
|
;;
|
|
697
715
|
|
|
698
|
-
"preemptible-killer")
|
|
699
|
-
installPreemptibleKiller # the gke preemptible node spreader outer
|
|
700
|
-
;;
|
|
701
|
-
|
|
702
716
|
"redis")
|
|
703
717
|
showInstalling "Redis Network Cache"
|
|
704
718
|
addHelmRepo bitnami https://charts.bitnami.com/bitnami
|
|
@@ -799,6 +813,9 @@ NOTRUNNING
|
|
|
799
813
|
}
|
|
800
814
|
|
|
801
815
|
# ---------- helmup MAIN ----------
|
|
816
|
+
GITTOP=`git rev-parse --show-toplevel` && cd $GITTOP
|
|
817
|
+
K8S_UTILS="${GITTOP}/k8s-utils"
|
|
818
|
+
|
|
802
819
|
overwhelm
|
|
803
820
|
[ $? -ne 0 ] && printf "\n\n***Aborting helmup...\n\n" && exit 1
|
|
804
821
|
|