@leverege/build-tools 2.48.5 → 2.49.0

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.
Files changed (57) hide show
  1. package/package.json +6 -5
  2. package/registry-compass.yaml +20 -0
  3. package/src/chart-compass.mjs +96 -0
  4. package/src/cnpg-snapshot.mjs +4 -29
  5. package/src/docker-to-registry.sh +611 -0
  6. package/src/helm-charts/api-server/values-local.yaml +7 -0
  7. package/src/helm-charts/authz-server/values-local.yaml +3 -0
  8. package/src/helm-charts/cnpg-db-pgbench/cnpg-db-pgbench.yaml.ovh +100 -0
  9. package/src/helm-charts/cnpg-db-pgbench/gitignore +2 -0
  10. package/src/helm-charts/cnpg-db-pgbench/helmdn.plugin +12 -0
  11. package/src/helm-charts/cnpg-db-pgbench/helmup.plugin +3 -0
  12. package/src/helm-charts/cnpg-db-pgbench/pooler.yaml +16 -0
  13. package/src/helm-charts/{db-postgres-stack/db-postgres-stack.yaml.ovh → cnpg-db-psql-stack/cnpg-db-psql-stack.yaml.ovh} +6 -24
  14. package/src/helm-charts/cnpg-db-psql-stack/gitignore +2 -0
  15. package/src/helm-charts/cnpg-db-psql-stack/helmdn.plugin +12 -0
  16. package/src/helm-charts/cnpg-db-psql-stack/helmup.plugin +3 -0
  17. package/src/helm-charts/cnpg-db-psql-stack/pooler.yaml +16 -0
  18. package/src/helm-charts/{db-timescale-plain/db-timescale-plain.yaml.ovh → cnpg-db-tsdb-basic/cnpg-db-tsdb-basic.yaml.ovh} +8 -28
  19. package/src/helm-charts/cnpg-db-tsdb-basic/gitignore +2 -0
  20. package/src/helm-charts/cnpg-db-tsdb-basic/helmdn.plugin +12 -0
  21. package/src/helm-charts/cnpg-db-tsdb-basic/helmup.plugin +3 -0
  22. package/src/helm-charts/cnpg-db-tsdb-basic/pooler.yaml +16 -0
  23. package/src/helm-charts/cnpg-db-tsdb-dense/.nohelm +0 -0
  24. package/src/helm-charts/cnpg-db-tsdb-dense/.nohelmdn +0 -0
  25. package/src/helm-charts/{db-timescale-dense/db-timescale-dense.yaml.ovh → cnpg-db-tsdb-dense/cnpg-db-tsdb-dense.yaml.ovh} +7 -27
  26. package/src/helm-charts/cnpg-db-tsdb-dense/gitignore +2 -0
  27. package/src/helm-charts/cnpg-db-tsdb-dense/helmdn.plugin +12 -0
  28. package/src/helm-charts/cnpg-db-tsdb-dense/helmup.plugin +5 -0
  29. package/src/helm-charts/cnpg-db-tsdb-dense/pooler.yaml +16 -0
  30. package/src/helm-charts/cnpg-operator/helmup.plugin +1 -1
  31. package/src/helm-charts/elasticsearch8/helmup.plugin +4 -5
  32. package/src/helm-charts/fota-server/values-local.yaml +3 -0
  33. package/src/helm-charts/kube-prometheus-stack/helmup.plugin +13 -0
  34. package/src/helm-charts/kube-prometheus-stack/old-values-local.yaml +764 -0
  35. package/src/helm-charts/pusher/values-local.yaml +2 -2
  36. package/src/helm-charts/resource-server/values-local.yaml +3 -0
  37. package/src/helm-charts/rule-engine/values-local.yaml +3 -0
  38. package/src/helm-charts/scheduler/values-local.yaml +3 -0
  39. package/src/helm-charts/transponder-tsdb/values-local.yaml +3 -0
  40. package/src/helm-charts/velero/helmup.plugin +1 -1
  41. package/src/helm-charts/velero/velero-local.yaml +1 -1
  42. package/src/helmup.sh +15 -26
  43. package/src/helm-charts/db-postgres-stack/gitignore +0 -1
  44. package/src/helm-charts/db-postgres-stack/helmdn.plugin +0 -3
  45. package/src/helm-charts/db-postgres-stack/helmup.plugin +0 -3
  46. package/src/helm-charts/db-timescale-dense/gitignore +0 -1
  47. package/src/helm-charts/db-timescale-dense/helmdn.plugin +0 -9
  48. package/src/helm-charts/db-timescale-dense/helmup.plugin +0 -5
  49. package/src/helm-charts/db-timescale-plain/gitignore +0 -1
  50. package/src/helm-charts/db-timescale-plain/helmdn.plugin +0 -3
  51. package/src/helm-charts/db-timescale-plain/helmup.plugin +0 -3
  52. /package/src/helm-charts/{db-postgres-stack → cnpg-db-pgbench}/.nohelm +0 -0
  53. /package/src/helm-charts/{db-postgres-stack → cnpg-db-pgbench}/.nohelmdn +0 -0
  54. /package/src/helm-charts/{db-timescale-dense → cnpg-db-psql-stack}/.nohelm +0 -0
  55. /package/src/helm-charts/{db-timescale-dense → cnpg-db-psql-stack}/.nohelmdn +0 -0
  56. /package/src/helm-charts/{db-timescale-plain → cnpg-db-tsdb-basic}/.nohelm +0 -0
  57. /package/src/helm-charts/{db-timescale-plain → cnpg-db-tsdb-basic}/.nohelmdn +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.48.5",
3
+ "version": "2.49.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -21,6 +21,7 @@
21
21
  "dirty-git": "src/dirty-git.sh",
22
22
  "dockreate": "src/dockreate.sh",
23
23
  "docker-to-registry": "src/docker-to-registry.mjs",
24
+ "docker-to-registry.sh": "src/docker-to-registry.sh",
24
25
  "encrypt-secrets": "src/encrypt-secrets.sh",
25
26
  "firebaseDeploy": "src/firebaseDeploy.mjs",
26
27
  "firebaseServe": "src/firebaseServe.mjs",
@@ -53,6 +54,7 @@
53
54
  "author": "Leverege Devs",
54
55
  "license": "SEE LICENSE IN LICENSE.md",
55
56
  "dependencies": {
57
+ "@google-cloud/artifact-registry": "^3.2.0",
56
58
  "ansi-colors": "^4.1.3",
57
59
  "chalk": "^5.3.0",
58
60
  "command-line-args": "^5.2.1",
@@ -60,9 +62,9 @@
60
62
  "deepmerge": "^4.3.1",
61
63
  "enquirer": "^2.4.1",
62
64
  "execa": "^8.0.1",
63
- "glob": "^10.3.10",
65
+ "glob": "^10.3.12",
64
66
  "handlebars": "^4.7.8",
65
- "inquirer": "^9.2.15",
67
+ "inquirer": "^9.2.16",
66
68
  "js-yaml": "^4.1.0",
67
69
  "ms": "^2.1.3",
68
70
  "npm-registry-fetch": "^16.1.0",
@@ -71,8 +73,7 @@
71
73
  "read-pkg": "^9.0.1",
72
74
  "readline-sync": "^1.4.10",
73
75
  "semver": "^7.6.0",
74
- "simple-git": "^3.22.0",
75
- "tempy": "^3.1.0",
76
+ "simple-git": "^3.24.0",
76
77
  "zx": "^7.2.3"
77
78
  },
78
79
  "devDependencies": {
@@ -0,0 +1,20 @@
1
+ registry:
2
+ - root: us-docker.pkg.dev
3
+ - repositories:
4
+ - name: stack
5
+ charts:
6
+ - api-server
7
+ - authz-server
8
+ - emailer
9
+ - message-processor
10
+ - name: leverege
11
+ charts:
12
+ - pubsub-pulse
13
+ - pusher
14
+ - overdose
15
+ - name: cox-health
16
+ charts:
17
+ - actions-server
18
+ - analytics-server
19
+ - centrak-healthz
20
+ - centrak-ingestor
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * chart-to-registry will...
4
+ */
5
+ import fs from 'node:fs'
6
+
7
+ import chalk from 'chalk'
8
+ import commandLineArgs from 'command-line-args'
9
+ import commandLineUsage from 'command-line-usage'
10
+ import { lt as semverLt } from 'semver'
11
+ import YAML from 'js-yaml'
12
+
13
+ import {
14
+ condir,
15
+ debug,
16
+ errorExit,
17
+ log,
18
+ warning,
19
+ getGitRootDirectory,
20
+ parsePackageJson,
21
+ parseHelmChart,
22
+ shellCmd } from './Utils.mjs'
23
+
24
+ const commandLineOptions = [ // Use commandLineOptions to tie into the Usage statements
25
+ /* eslint-disable max-len */
26
+ {
27
+ name : 'location',
28
+ type : String,
29
+ description : '{green the location of the artifact registry the chart will be pushed to (default us-docker.pkg.dev)}',
30
+ },
31
+ {
32
+ name : 'project',
33
+ type : String,
34
+ description : '{green the name of the google project containing the npmrc and slack config secrets (default leverege-registry)}',
35
+ },
36
+ {
37
+ name : 'repository',
38
+ type : String,
39
+ description : '{green the target repository to receive the pushed chart}',
40
+ },
41
+ {
42
+ name : 'dry-run',
43
+ type : Boolean,
44
+ description : '{yellow perform everything except the actual chart push}',
45
+ },
46
+ {
47
+ name : 'help',
48
+ type : Boolean,
49
+ description : '{green display this help screen}',
50
+ },
51
+ /* eslint-enable max-len */
52
+ ]
53
+
54
+ const sections = [
55
+ {
56
+ header : 'Leverege Helm Chart Compass (for helmup)',
57
+ content : `{green This tool helps helmup navigate the helm charts stored in the
58
+ artifact-registries.}`
59
+ },
60
+ { header : 'Options',
61
+ optionList : commandLineOptions,
62
+ },
63
+ ]
64
+
65
+ const args = commandLineArgs( commandLineOptions, { camelCase : true, partial : true } )
66
+ const usage = commandLineUsage( sections )
67
+
68
+ if ( args.help ) {
69
+ log( usage )
70
+ process.exit( 0 )
71
+ }
72
+
73
+ /* eslint-disable no-underscore-dangle */
74
+ if ( args._unknown ) {
75
+ log( usage )
76
+ log( `\nUnrecognized argument [${chalk.bold.red( args._unknown )}]\n` )
77
+ process.exit( 1 )
78
+ }
79
+ /* eslint-enable no-underscore-dangle */
80
+
81
+ const minNodejsVersion = '18.0.0'
82
+ if ( semverLt( process.version, minNodejsVersion ) ) {
83
+ errorExit( `\n***ERROR: must be running at least node ${minNodejsVersion}\n` )
84
+ }
85
+
86
+ // First of all, fail if we are not in a git repository
87
+ let gitRoot
88
+ try {
89
+ gitRoot = await getGitRootDirectory()
90
+ } catch ( error ) {
91
+ errorExit( chalk.red.bold( error ), { errorCode : 5 } )
92
+ }
93
+
94
+ const chartCompass = YAML.load( fs.readFileSync( './registry-compass.yaml', 'utf8' ) )
95
+
96
+ condir( { chartCompass }, '<==Navigation' )
@@ -1,38 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import fs from 'node:fs'
4
-
5
- import handlebars from 'handlebars'
6
- import { temporaryFile } from 'tempy'
7
-
8
3
  import {
9
- getDateTimestamp,
10
- debug,
4
+ log,
11
5
  shellCmd,
12
6
  } from './Utils.mjs'
13
7
 
14
- const backup = `
15
- apiVersion: postgresql.cnpg.io/v1
16
- kind: Backup
17
- metadata:
18
- name: {{clusterName}}-snapshot-{{dateTimestamp}}
19
- namespace: cnpg-operands
20
- labels:
21
- cnpg-backup: manual
22
- cnpg-operand: {{clusterName}}
23
- spec:
24
- method: volumeSnapshot
25
- cluster:
26
- name: {{clusterName}}`
27
-
28
- const dateTimestamp = getDateTimestamp()
29
8
  const clusterName = process.argv[2]
30
- const compiled = handlebars.compile( backup )
31
- const replaced = compiled( { dateTimestamp, clusterName } )
32
- const tmpfile = temporaryFile()
33
9
 
34
- debug( { replaced, tmpfile }, '<==Apply That' )
35
-
36
- fs.writeFileSync( tmpfile, replaced ) // eslint-disable-line security/detect-non-literal-fs-filename
37
10
  await shellCmd( 'overwhelm' )
38
- await shellCmd( `kubectl apply -f ${tmpfile}` )
11
+ await shellCmd( `kubectl cnpg backup -m volumeSnapshot -n cnpg-operands ${clusterName}` )
12
+
13
+ log( '\nTo see backups run => kubectl get backups.postgresql.cnpg.io -n cnpg-operands\n' )