@leverege/build-tools 2.40.2 → 2.42.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.40.2",
3
+ "version": "2.42.0-beta.1",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -70,6 +70,6 @@
70
70
  },
71
71
  "devDependencies": {
72
72
  "@leverege/eslint-config-leverege": "^4.2.0",
73
- "npm": "^10.1.0"
73
+ "npm": "^10.2.0"
74
74
  }
75
75
  }
@@ -0,0 +1,606 @@
1
+ #!/bin/bash
2
+ if [ -z "$1" ]; then
3
+ echo " Usage: docker-to-registry <version number>"
4
+ exit 1
5
+ fi
6
+
7
+ # printf "\n****LOCAL DOCKREATE****\n\n" && sleep 1
8
+
9
+ # The base docker image maybe overridden with:
10
+ #
11
+ # BASE_NODE_IMAGE="gallium-alpine" npm run dockerize <version>
12
+ #
13
+ BASE_NODE_IMAGE="${BASE_NODE_IMAGE:-hydrogen-alpine}" # node 18, hydrogen
14
+
15
+ # Load common bash functions
16
+ . `build-tools --bashfun`
17
+ PKGTOP="$npm_config_local_prefix"
18
+ cd $PKGTOP/docker
19
+
20
+ if [ ! -x "$(command -v jq)" ];
21
+ then
22
+ cat<<NO_JQ
23
+
24
+ `color r "***ERROR: Missing jq JSON processor"` => `color g 'brew install jq'`
25
+
26
+ NO_JQ
27
+ exit 1
28
+ fi
29
+
30
+ if [ ! -d "$PKGTOP/dist" ];
31
+ then
32
+ cat<<NO_DIST
33
+
34
+ `color r "***ERROR: Missing the dist directory, run this first => "``color g 'npm run build'`
35
+
36
+ NO_DIST
37
+ exit 1
38
+ fi
39
+
40
+ function packageJson() {
41
+ result=$(jq -r $1 $PKGTOP/package.json)
42
+ if [ "$result" != "null" ]
43
+ then
44
+ echo $result
45
+ else
46
+ echo $2
47
+ fi
48
+ }
49
+
50
+ # Global Vars
51
+ pluginFile="Dockerfile.plugin"
52
+
53
+ # cleanup trapper for gracefully killing, which doesn't do much right now
54
+ function cleanup() {
55
+ [ ! -z "$DOCKER_SKIP_CLEANUP" ] && printf "\nSkipping clean up\n\n" && exit 1
56
+ printf "\nCleaning up and exiting...\n\n"
57
+ rm -rf ./workspace ./scripts $SSHDIR .npmrc
58
+ exit 0
59
+ }
60
+ trap cleanup INT
61
+
62
+ function strip_undefined() {
63
+ local result="$1"
64
+ [ "$1" == "undefined" ] && result=""
65
+ printf "$result"
66
+ }
67
+
68
+ function create_DockerfilePlugin() {
69
+ [ -f 'Dockerfile.plugin' ] && return
70
+
71
+ cat<<DOCKERPLUGIN > Dockerfile.plugin
72
+ # Dockerfile.plugin - optionally extend the service Docker image
73
+ #
74
+ # This file may be used to run additional docker commands during the image
75
+ # build process without needing to maintain a local custom Dockerfile. For
76
+ # example, uncommenting the following docker RUN command will cause the
77
+ # curl and vim packages to be added to the deployed image thus making them
78
+ # available from the pod's command line on k8s:
79
+ #
80
+ # RUN apk update && apk add --no-cache curl vim
81
+ #
82
+ # Keep in mind that the Alpine Linux base image is used to keep image
83
+ # footprints small, so adding packages "just because" is not considered
84
+ # a best practice.
85
+ DOCKERPLUGIN
86
+ }
87
+
88
+ # Useful links with information regarding k8s/docker/nodejs and PID 1
89
+ # No PID 1 for NodeJS => https://bit.ly/2r4gHkZ
90
+ # What tini is all about => https://bit.ly/2HsSxqP
91
+ # Graceful kills with k8s => https://bit.ly/2NONEJG
92
+ #
93
+ # Params: $1 = version from dockerize invocation
94
+ # $2 = additional packages to install (htop redis-cli etc)
95
+ function create_Dockerfile() {
96
+ local regvers="${1}"
97
+ local apkadds="${2}"
98
+
99
+ create_DockerfilePlugin
100
+
101
+ echo "Creating the Dockerfile for node ${BASE_NODE_IMAGE}"
102
+ cat<<DOCKERBLD > Dockerfile
103
+ # Version ${regvers} @ `date`
104
+ #
105
+ # The FROM directive sets the Base Image for subsequent instructions
106
+ FROM node:${BASE_NODE_IMAGE} as intermediate
107
+ ENV NODE_ENV production
108
+
109
+ RUN mkdir -p /usr/src/app
110
+ WORKDIR /usr/src/app
111
+
112
+ # Install app dependencies
113
+ COPY ./workspace/ /usr/src/app/
114
+ ENV GRPC_VERBOSITY ERROR
115
+
116
+ # --------------------------------------------------------------
117
+ # copy the ssh keys into place, npm install, and remove them
118
+ # --------------------------------------------------------------
119
+
120
+ # Install packages to install private repos with ssh keys
121
+ COPY ./.npmrc /usr/src/app/.npmrc
122
+ RUN apk --no-cache add openssh-client && \
123
+ apk --update add --no-cache --virtual build-dep g++ gcc libgcc \\
124
+ libstdc++ linux-headers make ${apkadds} && \
125
+ npm install -g npm@9 && \
126
+ npm ci --only=production --ignore-scripts --no-optional ${npmlogging} && \
127
+ rm -f /usr/src/app/.npmrc /root/.ssh/*
128
+
129
+ # --------------------------------------------------------------
130
+ # On to the real build now, the thing before was just an intermediate container
131
+ # --------------------------------------------------------------
132
+
133
+ FROM node:${BASE_NODE_IMAGE}
134
+
135
+ # Install tini for PID 1 and replace shell with bash so we can source files
136
+ RUN apk update && \
137
+ apk add --no-cache bash curl tini vim ${apkadds} && \
138
+ npm install -g npm@9 && \
139
+ rm /bin/sh && ln -s /bin/bash /bin/sh && \
140
+ mkdir -p /usr/src/app /tmp/levlog && \
141
+ chown node:node /usr/src/app
142
+ DOCKERBLD
143
+
144
+ if [ -f "${pluginFile}" ];
145
+ then
146
+ printf "\n# ${pluginFile} BEGIN\n" >> Dockerfile
147
+ cat $pluginFile >> Dockerfile
148
+ printf "# ${pluginFile} END\n\n" >> Dockerfile
149
+ fi
150
+
151
+ cat<<EODOCKER >> Dockerfile
152
+ ENTRYPOINT [ "/sbin/tini", "--" ]
153
+ WORKDIR /usr/src/app
154
+
155
+ COPY --chown=node:node --from=intermediate /usr/src/app /usr/src/app
156
+
157
+ USER ${runuser}
158
+ COPY ./bashrc /home/node/.bashrc
159
+ CMD [ "/bin/bash", "-c", "node index.js" ]
160
+ EODOCKER
161
+ } # end of create_Dockerfile
162
+
163
+ # Params: $1 = version from dockerize invocation
164
+ function create_bashrc() {
165
+ cat<<EOBASHRC > bashrc
166
+ #!/bin/bash
167
+ #
168
+ # Version $1 @ `date`
169
+
170
+ alias h=history
171
+
172
+ alias ls='ls -CF --color=auto'
173
+ alias ll='ls -lh'
174
+ alias lla='ls -lha'
175
+ alias glep='grep -l -s'
176
+ alias m=less
177
+ alias menv='env | sort | less'
178
+
179
+ alias whatsmyip='wget -qO- ifconfig.co'
180
+
181
+ alias err='wget -q -O- localhost:5111/logLevel/error'
182
+ alias wrn='wget -q -O- localhost:5111/logLevel/warn'
183
+ alias inf='wget -q -O- localhost:5111/logLevel/info'
184
+ alias dbg='wget -q -O- localhost:5111/logLevel/debug'
185
+ alias trc='wget -q -O- localhost:5111/logLevel/trace'
186
+
187
+ socks()
188
+ {
189
+ netstat -ant | awk '{print $6}' | sort | uniq -c | sort -n
190
+ }
191
+
192
+ cmetrics()
193
+ {
194
+ wget -qO- localhost:5111/metrics
195
+ }
196
+
197
+ cmstat()
198
+ {
199
+ wget -qO- localhost:5111\${1}
200
+ }
201
+
202
+ cmclear()
203
+ {
204
+ cmstat /status/clear
205
+ }
206
+ EOBASHRC
207
+ } # end of create_bashrc
208
+
209
+ # Spilt a character delimited string and emit the object at the specified
210
+ # index. So passing a full registry string in like:
211
+ # us-docker.pkg.dev/leverege-registry/leverege
212
+ #
213
+ # the project name may be extracted by calling this like:
214
+ # getNthOvjectFromDelimitedString $registry 1 '/'
215
+ #
216
+ function getNthObjectFromDelimitedString() {
217
+ local inputStr=$1
218
+ local index=$2
219
+ local delimeter=$3
220
+
221
+ IFS=$delimeter
222
+ read -ra ADDR <<< "$inputStr"
223
+
224
+ echo ${ADDR[$2]}
225
+ }
226
+
227
+ # ---------- MAIN PROCESSING STARTS HERE ----------
228
+ #
229
+ # make sure we have a current npmrc file
230
+ refresh-npm-token
231
+
232
+ # deprecation checks first...
233
+ deprecated=$(packageJson '.leverege.project')
234
+ if [ ! -z "$deprecated" ];
235
+ then
236
+ cat<<DEPRECATED_PROJECT
237
+
238
+ $(color y '***DEPRECATED: leverege.project setting in package.json')
239
+
240
+ Setting the project in the package.json leverege section was used for builds
241
+ being stored in the deprecated GCP container registry. Remove the deprecated
242
+ leverege.project setting from package.json and try again.
243
+
244
+ "leverege": {
245
+ $(color r "\"project\": \"$deprecated\",")
246
+ ...
247
+ }
248
+
249
+ DEPRECATED_PROJECT
250
+ exit 1
251
+ fi
252
+
253
+ deprecated=$(packageJson '.leverege.container')
254
+ if [ ! -z "$deprecated" ];
255
+ then
256
+ cat<<DEPRECATED_CONTAINER
257
+
258
+ $(color y '***DEPRECATED: leverege.container is no longer supported')
259
+
260
+ Setting the container name explicitly from the package.json leverge block
261
+ is no longer supported. The container name will be automatically derived
262
+ from the git repository's remote root, which is the default behavior. Remove
263
+ the container line from the leverege section in package.json and try again.
264
+
265
+ "leverege": {
266
+ $(color r "\"container\": \"$deprecated\",")
267
+ ...
268
+ }
269
+ DEPRECATED_CONTAINER
270
+ exit 1
271
+ fi
272
+
273
+ deprecated=$(packageJson '.leverege.nodeimg')
274
+ if [ ! -z "$deprecated" ];
275
+ then
276
+ cat<<DEPRECATED_NODEIMAGE
277
+
278
+ $(color y '***DEPRECATED: leverege.nodeimg is no longer supported')
279
+
280
+ Setting the node base image using the nodeimg statement in package.json is no
281
+ longer supported. By default the actual node image version will be defaulted
282
+ by this script and wil rarely need to be a specific version. Remove the
283
+ nodeimg line from the leverege section in package.json and try again.
284
+
285
+ "leverege": {
286
+ $(color r "\"nodeimg\": \"$deprecated\",")
287
+ ...
288
+ }
289
+ DEPRECATED_NODEIMAGE
290
+ exit 1
291
+ fi
292
+
293
+ deprecated=$(packageJson '.leverege.artifact')
294
+ if [ ! -z "$deprecated" ];
295
+ then
296
+ cat<<DEPRECATED_ARTIFACT
297
+
298
+ $(color y '***DEPRECATED: leverege.artifact is no longer supported')
299
+
300
+ Setting the artifact registry folder is no longer supported. Instead use the
301
+ $(color g leverege.registry) setting to specify the full artifact registry and folder
302
+ used for storing the docker image. Remove the artifact line from the leverege
303
+ section in package.json and try again.
304
+
305
+ "leverege": {
306
+ $(color r "\"artifact\": \"$deprecated\",")
307
+ ...
308
+ }
309
+
310
+ $(color g "New syntax example:")
311
+
312
+ "leverege": {
313
+ $(color g "\"registry\": \"us-docker.pkg.dev/leverege-registry/$deprecated\",")
314
+ }
315
+ DEPRECATED_ARTIFACT
316
+ exit 1
317
+ fi
318
+
319
+ deprecated=$(packageJson '.leverege.nodeops')
320
+ if [ ! -z "$deprecated" ];
321
+ then
322
+ cat<<DEPRECATED_NODEOPS
323
+
324
+ $(color y '***DEPRECATED: leverege.nodeops are no longer supported')
325
+
326
+ Setting the hard coded node options on the image is no longer supported. The
327
+ better approach is to add $(color g 'NODE_OPTIONS') to the config section of the chart's
328
+ values.yaml to allow downstream users to easily tune the options as needed.
329
+ Remove the nodeops line from the leverege section in package.json and try again.
330
+
331
+ "leverege": {
332
+ $(color r "\"nodeops\": \"$deprecated\",")
333
+ ...
334
+ }
335
+ DEPRECATED_NODEOPS
336
+ exit 1
337
+ fi
338
+
339
+ # the container name will be the git root for the repo
340
+ gitremote=`git config --get remote.origin.url`
341
+ if [ -z $gitremote ];
342
+ then
343
+ cat<<NOCONTAINER
344
+
345
+ $(color r '***ERROR: attempting to build an unnamed container')
346
+
347
+ You are attempting to create a docker image without a container name or
348
+ a git remote setup. Either define a $(color y 'container') statement in the leverege
349
+ section of package.json, or add a $(color g 'git remote') to this repository.
350
+
351
+ NOCONTAINER
352
+ exit 1
353
+ fi
354
+ container=$(basename $gitremote .git)
355
+
356
+ # build the registry specification
357
+ registry=$(packageJson '.leverege.registry')
358
+ if [ ! -z "$registry" ];
359
+ then
360
+ gcp_project="$(getNthObjectFromDelimitedString $registry 1 '/')"
361
+ registry_folder=$registry/images/$container
362
+ else
363
+ cat<<MISSING_REGISTRY
364
+
365
+ $(color r '***ERROR: the leverege.registry setting is required in package.json')
366
+
367
+ The $(color g 'leverege.registry') setting is now required and must be set to point to the
368
+ base URL of the artifact registry, plus the folder that the image is to be
369
+ stored in. For example, the Leverege Google project that contains our artifact
370
+ registry is $(color g 'leverege-registry') which contains several folders that are used to
371
+ group images by commonality. The stack services store their images in the
372
+ $(color g 'stack') folder, while general purpose services that we use may end up in the
373
+ $(color g 'leverege') folder.
374
+
375
+ Using api-server as an example, given this setting in api-server's package.json:
376
+
377
+ "leverege": {
378
+ $(color g '"registry": "us-docker.pkg.dev/leverege-registry/stack"')
379
+ }
380
+
381
+ the resultant docker image gets stored in:
382
+
383
+ $(color g 'us-docker.pkg.dev/leverege-registry/stack/images/api-server')
384
+
385
+ The helm/values.yaml file would then reference the same location:
386
+
387
+ image:
388
+ pullPolicy: IfNotPresent
389
+ registry: $(color g 'us-docker.pkg.dev/leverege-registry/leverege/images')
390
+ tag: ""
391
+ MISSING_REGISTRY
392
+ exit 1
393
+ fi
394
+
395
+ # verify the cloud build bucket exists
396
+ #
397
+ build_bucket="gs://${gcp_project}_cloudbuild"
398
+ gsutil ls -p $gcp_project -b $build_bucket &> /dev/null
399
+ if [ "$?" -ne 0 ];
400
+ then
401
+ cat<<MISSING_BUILD_BUCKET
402
+
403
+ $(color r "***ERROR: missing the cloud build bucket $build_bucket")
404
+
405
+ Go to Cloud Storage on the $(color g $gcp_project) GCP project and create the
406
+ target cloud build bucket before proceeding.
407
+
408
+ Build bucket => $(color g $build_bucket)
409
+ MISSING_BUILD_BUCKET
410
+ exit 1
411
+ fi
412
+
413
+ version=$1
414
+ [[ -f '.previous' ]] && previous=`cat .previous` || previous='FIRST BUILD'
415
+ #pckgver="v`node -p \"require('../package.json').version\"`"
416
+ pckgver="v$(packageJson '.version')"
417
+ pckgdts="`date +\"%Y%m%d-%H%M\"`"
418
+ # egrep was deprecated in 2007!
419
+ tagging=`echo $version | egrep -e "^v\d+\.\d+\.\d+$"`
420
+
421
+ if [ $tagging ];
422
+ then
423
+ if [[ `git status --porcelain` ]]; then
424
+ cat<<DIRTAG
425
+
426
+ $(color r '***ERROR: attempting to tag a non-beta dirty git repository')
427
+
428
+ You are attempting to create a tagged release image for pushing to the
429
+ container registry, but there are locally modified files. This is not
430
+ allowed since the applied tag will not be relevant to the image version
431
+ due to the pending commits.
432
+
433
+ Available options for proceeding:
434
+
435
+ $(color g '1) cleanly commit all local mods assuming relevance')
436
+ $(color y '2) eliminate unwanted local modifications')
437
+ $(color r '3) stash anything that is irrelevant to this release')
438
+
439
+
440
+ DIRTAG
441
+ exit 1
442
+ fi
443
+
444
+ # since we're tagging, the current branch must have an upstream
445
+ branch=`git rev-parse --abbrev-ref HEAD`
446
+ git rev-parse --abbrev-ref ${branch}@{u} &> /dev/null
447
+
448
+ if [ $? -ne 0 ];
449
+ then
450
+ cat<<NOUPSTR
451
+
452
+ $(color r '***ERROR: the current branch must have an upstream')
453
+
454
+ You are attempting to create a tagged release image for pushing to the
455
+ container registry, but the current branch does not have an upstream to
456
+ push to. This is not allowed since the applied tag will be stranded here
457
+ in your local repository, which is what we are attempting to avoid.
458
+
459
+ Available options for proceeding:
460
+
461
+ $(color g '1) set an upstream for this branch via:')
462
+ $(color g " git push --set-upstream origin ${branch}")
463
+
464
+ $(color y '2) rebase, squash and merge onto a branch with an upstream')
465
+
466
+ NOUPSTR
467
+ exit 1
468
+ fi
469
+
470
+ tagstat=$(color y 'will be tagged')
471
+ else
472
+ tagstat=$(color r 'BETA RELEASE WILL NOT BE TAGGED')
473
+ fi
474
+
475
+ pluggedIn=$(color g "no")
476
+ [ -f "${pluginFile}" ] && pluggedIn=$(color y "YES")
477
+
478
+ apkadds=$(packageJson '.leverege.apkadds')
479
+ runuser=$(packageJson '.leverege.runuser')
480
+ [ -z "${runuser}" ] && runuser='node'
481
+
482
+ npmlogging='--silent' # allow for verbose npm logs
483
+ if [ "$VERBOSE_DOCKREATE_NPM" == "yes" ];
484
+ then
485
+ npmlogging='--ddd'
486
+ else
487
+ hintverbose=1
488
+ fi
489
+
490
+ echo "Updating dependencies and workspace..." && npm install
491
+ if [ $? -ne 0 ];
492
+ then
493
+ cat<<INSTALLFAILED
494
+
495
+ $(color y 'npm install') $(color r 'FAILED') - fix it in order to proceed
496
+
497
+ INSTALLFAILED
498
+ exit 1
499
+ fi
500
+
501
+ cat<<IMGINFO
502
+ Project: $(color g $gcp_project)
503
+ Registry: $(color g $registry)
504
+ Container: $(color g $container)
505
+ Version: $(color g $version) $tagstat
506
+ Folder: $(color y $registry_folder)
507
+ NodeImage: $(color g $BASE_NODE_IMAGE)
508
+ AddedPkgs: $(color g $apkadds)
509
+ PluggedIn: ${pluggedIn}
510
+ Run User: $(color g $runuser)
511
+ Previous: $(color y $previous)
512
+ DateStamp: $(color g $pckgdts)
513
+ NPM Logs: $(color g $npmlogging)
514
+
515
+ IMGINFO
516
+
517
+ [ $hintverbose ] && printf " Define $(color g VERBOSE_DOCKREATE_NPM=\"yes\") for verbose build logging\n\n"
518
+
519
+ if [ "$pckgver" != "$version" ];
520
+ then
521
+ cat<<EOPKG
522
+ $(color y '***WARNING: specified version does not match package.json version' )
523
+ package.json => $(color g "$pckgver")
524
+ specified => $(color r "$version")
525
+
526
+ EOPKG
527
+ if [ $tagging ];
528
+ then
529
+ cat<<EONOPE
530
+
531
+ $(color r '... and you are attempting to release so NOPE!' )
532
+
533
+ EONOPE
534
+ exit 1
535
+ fi
536
+ fi
537
+
538
+ create_Dockerfile "$version" "$apkadds"
539
+ create_bashrc "$version"
540
+
541
+ rm -rf ./workspace && mkdir -p ./workspace
542
+ cp -rfp ${PKGTOP}/package*json ${PKGTOP}/dist/* ./workspace
543
+
544
+ # grab the npmrc token for the image
545
+ cp -f "$HOME/.npmrc" .npmrc
546
+
547
+ [ "$CIRCLECI" == "true" ] && exit 0
548
+
549
+ printf "Hit return to continue or ^C to exit\n\n"; read ANS
550
+
551
+ echo $version > .previous
552
+
553
+ echo "Changing Google Project to $project"
554
+ gcloud config set project $gcp_project
555
+
556
+ echo "Creating Docker Image for $registry_folder:$version"
557
+ echo " Building the workspace"
558
+
559
+ # use kaniko to cache builds
560
+ if [ "$USE_KANIKO" == "yes" ];
561
+ then
562
+ gcloud config set builds/use_kaniko True
563
+ else
564
+ gcloud config unset builds/use_kaniko
565
+ fi
566
+
567
+ # need a logging area outside of the default cloud build bucket in order
568
+ # to enable 3rd party builders from outside of leverege.com user space
569
+ build_logs="--gcs-log-dir $build_bucket/logs"
570
+
571
+ # submit the build request to gcloud with logs directed to the cloudbuild
572
+ # logging bucket from the docker directory
573
+ time gcloud builds submit $build_logs --tag $registry_folder:$version .
574
+
575
+ if [ $? -ne 0 ];
576
+ then
577
+ bldErr=$?
578
+ cat<<BUILDERR
579
+
580
+ $(color r '***ERROR: build failed! Aborting without tagging.')
581
+
582
+ The gcloud build process seems to have run into a problem. Please fix the
583
+ issue and rerun the dockerize process. This build will not be tagged, nor
584
+ will it be pushed.
585
+
586
+ BUILDERR
587
+ exit $bldErr
588
+ fi
589
+
590
+ # Tag the container with the node detailsand the culprit.
591
+ gcloud container images add-tag --quiet $registry_folder:$version \
592
+ $registry_folder:$pckgdts-$BASE_NODE_IMAGE-$USER \
593
+ $registry_folder:latest
594
+
595
+ if [ $tagging ];
596
+ then
597
+ printf "\n$(color g "Tagging and Pushing $version")\n"
598
+ git tag -af $1 -m "Docker version $1"
599
+ git push --follow-tags
600
+ # gcloud container images add-tag --quiet $gcimage:$version $gcimage:latest
601
+ # [ ! -z "$artifact" ] && gcloud container images add-tag --quiet $registry:$version $registry:latest
602
+ else
603
+ printf "\n$(color y '*** Skipped git tagging - beta release')\n\n"
604
+ fi
605
+
606
+ cleanup
@@ -0,0 +1,13 @@
1
+ image:
2
+ tag: # v5.4.4
3
+
4
+ config:
5
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
6
+
7
+ autoscaling:
8
+ minReplicas: 3
9
+ maxReplicas: 12
10
+ maxCPU: 80
11
+
12
+ ingressRoute:
13
+ host: OVH:<PROJECT_ID>-imagine-api.OVH:<HOST>.com
@@ -0,0 +1,5 @@
1
+ image:
2
+ tag: # v1.3.1
3
+
4
+ config:
5
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -0,0 +1,7 @@
1
+ image:
2
+ tag: # v4.1.0
3
+
4
+ config:
5
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
6
+ TSDB_CLEANUP_ENABLED: "true"
7
+ FIREBASE_CLEANUP_ENABLED: "true"
@@ -0,0 +1,9 @@
1
+ image:
2
+ tag: # v3.3.1
3
+
4
+ config:
5
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
6
+
7
+ API_UI_URL: "OVH:<PROJECT_ID>.web.app"
8
+ MAIL_GUN_DOMAIN: "OVH:<MAIL_GUN_DOMAIN>"
9
+ MAIL_GUN_DEFAULT_SENDER: "no-reply@OVH:<MAIL_GUN_DOMAIN>"
@@ -0,0 +1,8 @@
1
+ image:
2
+ tag: # v1.1.0
3
+
4
+ config:
5
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
6
+ PROJECT_ID: 'set-me-in-values-local'
7
+ SYSTEM_ID: 'set-me-in-values-local'
8
+ NETWORK_ID: 'set-me-in-values-local'
@@ -0,0 +1,7 @@
1
+ image:
2
+ tag: # v2.3.0
3
+
4
+ config:
5
+ UPLOADER_TYPE: "OVH:<BUCKET_TYPE>"
6
+ UPLOADER_PROJECT_ID: "OVH:<PROJECT_ID>"
7
+ UPLOADER_BUCKET: "OVH:<PROJECT_ID>-geotiles"
@@ -0,0 +1,5 @@
1
+ mage:
2
+ tag: # v2.2.0
3
+
4
+ config:
5
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -0,0 +1,5 @@
1
+ image:
2
+ tag: # v3.5.0
3
+
4
+ config:
5
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -0,0 +1,14 @@
1
+ image:
2
+ tag: # v2.2.0
3
+
4
+ config:
5
+ CF_TRANSPORT_CONFIG: '{
6
+ "type": "pubsub",
7
+ "projectId": "OVH:<PROJECT_NAME>" ,
8
+ "keyFilename": "/home/node/unused/key.json" ,
9
+ "publisher": {
10
+ "batching": {
11
+ "maxMilliseconds": 0
12
+ }
13
+ }
14
+ }'
@@ -0,0 +1,9 @@
1
+ image:
2
+ tag: # v1.0.1
3
+
4
+ config:
5
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
6
+
7
+ UPLOADER_PROJECT_ID: "OVH:<PROJECT_ID>"
8
+ UPLOADER_BUCKET: "OVH:<PROJECT_ID>-resource-server"
9
+ UPLOADER_LOCATION: "OVH:<GCE_REGION>"
@@ -0,0 +1,5 @@
1
+ image:
2
+ tag: # v2.0.0
3
+
4
+ config:
5
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -0,0 +1,5 @@
1
+ image:
2
+ tag: # v2.3.0
3
+
4
+ config:
5
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -0,0 +1,29 @@
1
+ nameOverride: transponder-bq
2
+
3
+ image:
4
+ tag: # v5.0.1
5
+
6
+ config:
7
+ TRANSPONDER_RUN_MODE: "bigQueryJson"
8
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
9
+
10
+ TRANSPORT_CONFIG: '{
11
+ "type": "pubsub",
12
+ "projectId": "OVH:<PROJECT_ID>",
13
+ "publisher": {
14
+ "batching": {
15
+ "maxMilliseconds": 0,
16
+ "maxMessages": 999
17
+ }
18
+ },
19
+ "subscriptionOptions": {
20
+ "flowControl": {
21
+ "allowExcessMessages": false,
22
+ "maxMessages": 50
23
+ },
24
+ "streamingOptions": {
25
+ "maxStreams": 5
26
+ }
27
+ },
28
+ "channel": "writer-bq"
29
+ }'
@@ -0,0 +1,30 @@
1
+ nameOverride: transponder-rt
2
+
3
+ image:
4
+ tag: v5.0.1
5
+
6
+ config:
7
+ TRANSPONDER_RUN_MODE: "rt"
8
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
9
+
10
+ ELASTICSEARCH_DATA_METADATA_ENABLED: "false"
11
+ TRANSPORT_CONFIG: '{
12
+ "type": "pubsub",
13
+ "projectId": "OVH:<PROJECT_ID>",
14
+ "publisher": {
15
+ "batching": {
16
+ "maxMilliseconds": 0,
17
+ "maxMessages": 999
18
+ }
19
+ },
20
+ "subscriptionOptions": {
21
+ "flowControl": {
22
+ "allowExcessMessages": false,
23
+ "maxMessages": 10
24
+ },
25
+ "streamingOptions": {
26
+ "maxStreams": 5
27
+ }
28
+ },
29
+ "channel": "writer-rt"
30
+ }'
@@ -0,0 +1,35 @@
1
+ # in order to add workload id to existing SA:
2
+ #
3
+ # gcloud iam service-accounts add-iam-policy-binding --project=prd-recovr-auto \
4
+ # --member 'serviceAccount:prd-recovr-auto.svc.id.goog[default/transponder-tsdb]' \
5
+ # --role 'roles/iam.workloadIdentityUser' transponder@prd-recovr-auto.iam.gserviceaccount.com
6
+ #
7
+ nameOverride: transponder-tsdb
8
+
9
+ image:
10
+ tag: # v5.0.1
11
+
12
+ config:
13
+ TRANSPONDER_RUN_MODE: "timescale"
14
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
15
+
16
+ TRANSPORT_CONFIG: '{
17
+ "type": "pubsub",
18
+ "projectId": "OVH:<PROJECT_NAME>",
19
+ "publisher": {
20
+ "batching": {
21
+ "maxMilliseconds": 0,
22
+ "maxMessages": 999
23
+ }
24
+ },
25
+ "subscriptionOptions": {
26
+ "flowControl": {
27
+ "allowExcessMessages": false,
28
+ "maxMessages": 25
29
+ },
30
+ "streamingOptions": {
31
+ "maxStreams": 5
32
+ }
33
+ },
34
+ "channel": "writer-tsdb"
35
+ }'
package/src/helmup.sh CHANGED
@@ -769,6 +769,10 @@ CATBACKUP
769
769
  ;;
770
770
 
771
771
  *)
772
+ # if the service dir is missing then check to see if it's a platform
773
+ # service and if it is then try to bootstrap from charts in build-tools
774
+ [[ ! -d $SERVICE && ${PLATFORM[@]} =~ $SERVICE ]] && bootstrapLocalSetup $SERVICE
775
+
772
776
  if [ ! -d $SERVICE ] || [ ! -f $SERVICE/values-local.yaml ];
773
777
  then
774
778
  printf "\n$YELO_WARN Skipping unknown service => $SERVICE - missing `color r $SERVICE/values-local.yaml`\n\n"