@leverege/build-tools 2.98.0 → 2.98.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/.vscode/launch.json +10 -0
- package/package.json +3 -4
- package/src/Utils.mjs +6 -6
- package/src/chart-to-museum.mjs +3 -1
- package/src/helm-charts/prom-operator/helmup.plugin +1 -1
- package/src/helm-charts/prom-operator/prometheus-stack.yaml.ovh +3 -3
- package/src/helm-charts/prom-operator/stackdriver-exporter.yaml.ovh +1 -1
- package/src/helm-charts/valkey/valkey-local.yaml +2 -2
- package/src/helm-charts/velero/helmup.plugin +2 -2
- package/src/helmup.sh +1 -1
- package/src/init-my-chart/Chartwright.mjs +13 -6
- package/src/init-my-chart/values.yaml.hbs +0 -4
- package/src/push-my-chart.mjs +43 -26
package/.vscode/launch.json
CHANGED
|
@@ -18,6 +18,16 @@
|
|
|
18
18
|
},
|
|
19
19
|
"outputCapture": "std"
|
|
20
20
|
},
|
|
21
|
+
{
|
|
22
|
+
"name": "push-my-chart rsrc-srvr",
|
|
23
|
+
"type": "node",
|
|
24
|
+
"request": "launch",
|
|
25
|
+
"program": "${workspaceFolder}/src/push-my-chart.mjs",
|
|
26
|
+
"args": [],
|
|
27
|
+
"cwd": "/Users/john/Work/leverege/cicd/@plt/resource-server",
|
|
28
|
+
"runtimeExecutable": "node",
|
|
29
|
+
"console": "integratedTerminal"
|
|
30
|
+
},
|
|
21
31
|
{
|
|
22
32
|
"name": "ingestor in monorepo",
|
|
23
33
|
"type": "node",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.98.
|
|
3
|
+
"version": "2.98.1",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"build-tools": "src/build-tools.mjs",
|
|
22
22
|
"change-up": "src/change-up.sh",
|
|
23
23
|
"chart-compass": "src/chart-compass.mjs",
|
|
24
|
-
"chart-to-museum": "src/chart-to-museum.mjs",
|
|
25
24
|
"chart-to-registry": "src/chart-to-registry.mjs",
|
|
26
25
|
"circleate": "src/circleate.sh",
|
|
27
26
|
"clone-cnpg-from-snapshot": "src/clone-cnpg-from-snapshot.mjs",
|
|
@@ -104,7 +103,7 @@
|
|
|
104
103
|
"readline-sync": "^1.4.10",
|
|
105
104
|
"semver": "^7.7.4",
|
|
106
105
|
"shell-quote": "^1.8.3",
|
|
107
|
-
"simple-git": "^3.
|
|
106
|
+
"simple-git": "^3.33.0",
|
|
108
107
|
"sloc": "^0.3.2",
|
|
109
108
|
"superstruct": "^2.0.2",
|
|
110
109
|
"tmp": "^0.2.5",
|
|
@@ -116,6 +115,6 @@
|
|
|
116
115
|
"@leverege/eslint-config-leverege": "^5.1.2",
|
|
117
116
|
"chai": "^6.2.2",
|
|
118
117
|
"mocha": "^11.7.5",
|
|
119
|
-
"npm": "^11.11.
|
|
118
|
+
"npm": "^11.11.1"
|
|
120
119
|
}
|
|
121
120
|
}
|
package/src/Utils.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { glob } from 'glob'
|
|
|
10
10
|
import { packageUp } from 'package-up'
|
|
11
11
|
import { parse } from 'shell-quote'
|
|
12
12
|
import toml from 'toml'
|
|
13
|
+
import semver from 'semver'
|
|
13
14
|
import YAML from 'js-yaml'
|
|
14
15
|
|
|
15
16
|
// __dirname goes away with ESM so we take this approach instead and
|
|
@@ -544,15 +545,14 @@ export const parseHelmChart = async ( helmroot = './helm' ) => {
|
|
|
544
545
|
let depsOutOfSync = hasDependencies // assume unsynced if dependencies
|
|
545
546
|
if ( chartFiles.includes( 'Chart.lock' ) ) {
|
|
546
547
|
const chartLock = YAML.load( fs.readFileSync( `${helmroot}/Chart.lock`, 'utf8' ) )
|
|
547
|
-
|
|
548
|
-
const chartDeps = Object.fromEntries(
|
|
549
|
-
chartYaml.dependencies.map( d => [ d.name, d.version ] )
|
|
550
|
-
)
|
|
548
|
+
|
|
551
549
|
const lockDeps = Object.fromEntries(
|
|
552
550
|
chartLock.dependencies.map( d => [ d.name, d.version ] )
|
|
553
551
|
)
|
|
554
|
-
|
|
555
|
-
|
|
552
|
+
|
|
553
|
+
const mismatches = chartYaml.dependencies.filter( ( { name, version } ) => {
|
|
554
|
+
const lockedVersion = lockDeps[name]
|
|
555
|
+
return !lockedVersion || !semver.satisfies( lockedVersion, version )
|
|
556
556
|
} )
|
|
557
557
|
|
|
558
558
|
depsOutOfSync = mismatches.length > 0
|
package/src/chart-to-museum.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
// *** DEPRECATED: this goes away when we move away from the chart museum and
|
|
3
|
+
// push-my-chart already handles this a artifact pushes
|
|
4
|
+
//
|
|
3
5
|
import chalk from 'chalk'
|
|
4
6
|
import commandLineArgs from 'command-line-args'
|
|
5
7
|
import commandLineUsage from 'command-line-usage'
|
|
@@ -8,7 +8,7 @@ showInstalling "The Prometheus Operator (kube-prometheus-stack)"
|
|
|
8
8
|
|
|
9
9
|
# https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack
|
|
10
10
|
OCI_CHART="oci://ghcr.io/prometheus-community/charts/kube-prometheus-stack"
|
|
11
|
-
[ -z "$PROMETHEUS_STACK_CHART_VERSION" ] && PROMETHEUS_STACK_CHART_VERSION="82.
|
|
11
|
+
[ -z "$PROMETHEUS_STACK_CHART_VERSION" ] && PROMETHEUS_STACK_CHART_VERSION="82.10.3"
|
|
12
12
|
helm upgrade $NS --install prometheus-stack $OCI_CHART \
|
|
13
13
|
--values prom-operator/prometheus-stack.yaml \
|
|
14
14
|
--version $PROMETHEUS_STACK_CHART_VERSION $HELM_WHAT
|
|
@@ -146,7 +146,7 @@ extraManifests:
|
|
|
146
146
|
- websecure
|
|
147
147
|
routes:
|
|
148
148
|
- kind: Rule
|
|
149
|
-
match: Host(`${
|
|
149
|
+
match: Host(`${PROJECT_NAME}-prometheus.${HOST}.com`)
|
|
150
150
|
middlewares:
|
|
151
151
|
- name: basic-auth
|
|
152
152
|
services:
|
|
@@ -224,7 +224,7 @@ alertmanager:
|
|
|
224
224
|
slack_configs:
|
|
225
225
|
- channel: "${SLACK_CHANNEL}"
|
|
226
226
|
api_url: "${SLACK_HOOK_URL}"
|
|
227
|
-
username: "${
|
|
227
|
+
username: "${PROJECT_NAME}"
|
|
228
228
|
send_resolved: true
|
|
229
229
|
title: '{{ .CommonLabels.alertname }} alert'
|
|
230
230
|
title_link: '#'
|
|
@@ -261,7 +261,7 @@ alertmanager:
|
|
|
261
261
|
{{- end }}
|
|
262
262
|
|
|
263
263
|
{{- if .Labels.pod }}
|
|
264
|
-
*Pod Link:* *<https://console.cloud.google.com/kubernetes/pod/${GCE_REGION}/${CLUSTER_NAME}/{{ .Labels.namespace }}/{{ .Labels.pod }}?project=${
|
|
264
|
+
*Pod Link:* *<https://console.cloud.google.com/kubernetes/pod/${GCE_REGION}/${CLUSTER_NAME}/{{ .Labels.namespace }}/{{ .Labels.pod }}?project=${PROJECT_NAME}|`{{ .Labels.pod }}`>*
|
|
265
265
|
{{- end }}
|
|
266
266
|
|
|
267
267
|
*Status:* `{{ .Status }}` | *Severity:* `{{ .Labels.severity }}` {{- if .Labels.container }} *Container:* `{{ .Labels.container }}` {{- end }}
|
|
@@ -18,7 +18,7 @@ primary:
|
|
|
18
18
|
replicaCount: 1
|
|
19
19
|
|
|
20
20
|
# https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15
|
|
21
|
-
resourcesPreset: "
|
|
21
|
+
resourcesPreset: "medium"
|
|
22
22
|
# resources:
|
|
23
23
|
# requests:
|
|
24
24
|
# cpu: 250m
|
|
@@ -54,7 +54,7 @@ replica:
|
|
|
54
54
|
replicaCount: 1
|
|
55
55
|
|
|
56
56
|
# https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15
|
|
57
|
-
resourcesPreset: "
|
|
57
|
+
resourcesPreset: "medium"
|
|
58
58
|
# resources:
|
|
59
59
|
# requests:
|
|
60
60
|
# cpu: 250m
|
|
@@ -5,8 +5,8 @@ showInstalling "Velero Backup System"
|
|
|
5
5
|
# We use a specific version for the velero chart because we need to control
|
|
6
6
|
# the version of the locally installed velero client application.
|
|
7
7
|
#
|
|
8
|
-
VELERO_CHART_VERSION="11.
|
|
9
|
-
EXPECTED_CLIENT_VERSION="v1.
|
|
8
|
+
VELERO_CHART_VERSION="11.4.0"
|
|
9
|
+
EXPECTED_CLIENT_VERSION="v1.18.0"
|
|
10
10
|
|
|
11
11
|
addHelmRepo vmware-tanzu https://vmware-tanzu.github.io/helm-charts
|
|
12
12
|
|
package/src/helmup.sh
CHANGED
|
@@ -522,7 +522,6 @@ function getServiceAndChartInfo() {
|
|
|
522
522
|
CHARTVER="$(jq -r --arg svc "$SERVICE" '.[$svc].chart // empty' "$versions_file")"
|
|
523
523
|
[[ -n "$CHARTVER" ]] && FROM_VERSIONS=1
|
|
524
524
|
fi
|
|
525
|
-
|
|
526
525
|
return 0
|
|
527
526
|
}
|
|
528
527
|
|
|
@@ -687,6 +686,7 @@ REBOOTSTRAP
|
|
|
687
686
|
transponder-*)
|
|
688
687
|
# transponders use the same chart but different deployment name
|
|
689
688
|
[ ! -d $SERVICE ] && bootstrapLocalSetup $SERVICE
|
|
689
|
+
CHARTLOC="oci://us-docker.pkg.dev/leverege-registry/stack/charts/transponder" # always use art-reg
|
|
690
690
|
HELMUP="helm upgrade --install $SERVICE $CHARTLOC --values $SERVICE/values.yaml $CHARTVER $HELM_WHAT"
|
|
691
691
|
doHelmup "$HELMUP"
|
|
692
692
|
;;
|
|
@@ -31,9 +31,16 @@ const PRESERVE_SECTIONS = new Set( [
|
|
|
31
31
|
] )
|
|
32
32
|
|
|
33
33
|
// Helper functions
|
|
34
|
-
const
|
|
34
|
+
const OBSOLETE_SECTIONS = [
|
|
35
|
+
'ingressRoute',
|
|
36
|
+
'loadbalancer',
|
|
37
|
+
'udploadbalancer',
|
|
38
|
+
'podAnnotations',
|
|
39
|
+
'workloadIdentity'
|
|
40
|
+
]
|
|
41
|
+
const warnDeprecatedSections = ( doc ) => {
|
|
35
42
|
let deprecationWarningShown = false
|
|
36
|
-
for ( const key of
|
|
43
|
+
for ( const key of OBSOLETE_SECTIONS ) {
|
|
37
44
|
if ( !doc.has( key ) ) continue
|
|
38
45
|
Utils.log( `${chalk.yellow.bold( '⚠️ WARNING:' )} Deprecated values.yaml section detected => ${chalk.red.bold( key )}` )
|
|
39
46
|
deprecationWarningShown = true
|
|
@@ -138,10 +145,10 @@ export class Chartwright {
|
|
|
138
145
|
// Now we need to smart merge the values.yaml template while preserving existing sections
|
|
139
146
|
const baseValuesDoc = YAML.parseDocument( this.templates.Values )
|
|
140
147
|
const existingValuesDoc = YAML.parseDocument( ValuesText )
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
148
|
+
// warn about obsolete sections
|
|
149
|
+
warnDeprecatedSections( existingValuesDoc )
|
|
150
|
+
|
|
151
|
+
// Merge legacy values.yaml with new base, preserving formatting and comments
|
|
145
152
|
this.mergeTopLevelAddMissing( baseValuesDoc, existingValuesDoc )
|
|
146
153
|
this.applyPreserveSections( baseValuesDoc, existingValuesDoc )
|
|
147
154
|
|
package/src/push-my-chart.mjs
CHANGED
|
@@ -3,9 +3,14 @@
|
|
|
3
3
|
import chalk from 'chalk'
|
|
4
4
|
import commandLineArgs from 'command-line-args'
|
|
5
5
|
import commandLineUsage from 'command-line-usage'
|
|
6
|
-
import { lt as semverLt } from 'semver'
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
debug,
|
|
9
|
+
errorExit,
|
|
10
|
+
log,
|
|
11
|
+
parseHelmChart,
|
|
12
|
+
shellCmd
|
|
13
|
+
} from './Utils.mjs'
|
|
9
14
|
|
|
10
15
|
const commandLineOptions = [
|
|
11
16
|
{
|
|
@@ -48,34 +53,46 @@ if ( args.help ) {
|
|
|
48
53
|
process.exit( 0 )
|
|
49
54
|
}
|
|
50
55
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
const {
|
|
57
|
+
chartName,
|
|
58
|
+
chartVersion,
|
|
59
|
+
depsOutOfSync,
|
|
60
|
+
} = await parseHelmChart( args.chart )
|
|
54
61
|
|
|
55
|
-
|
|
62
|
+
log( chalk.green( `Chart => ${chalk.bold.yellow( chartName )}` ) )
|
|
63
|
+
log( chalk.green( `Version => ${chalk.bold.yellow( chartVersion )}` ) )
|
|
64
|
+
|
|
65
|
+
if ( depsOutOfSync ) {
|
|
56
66
|
try {
|
|
57
|
-
log( chalk.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
log( ex.stderr )
|
|
62
|
-
museumStatus = 1
|
|
67
|
+
log( chalk.yellow.bold( '\nChart dependedencies are out of sync - updating...\n' ) )
|
|
68
|
+
await shellCmd( 'helm dependency update ./helm', { stdio : 'inherit' } )
|
|
69
|
+
} catch ( error ) {
|
|
70
|
+
errorExit( error )
|
|
63
71
|
}
|
|
72
|
+
}
|
|
64
73
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
74
|
+
let museumStatus = 0
|
|
75
|
+
try {
|
|
76
|
+
log( chalk.green( ' ... pushing to the Museum' ) )
|
|
77
|
+
const museum = await shellCmd( `helm cm-push ${args.chart} leverege` )
|
|
78
|
+
debug( { museum }, '<==output from helm push' )
|
|
79
|
+
} catch ( ex ) {
|
|
80
|
+
// log( ex.stderr )
|
|
81
|
+
log( ex.message )
|
|
82
|
+
museumStatus = 1
|
|
83
|
+
}
|
|
69
84
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
debug( { registry }, '<==chart-to-registry' )
|
|
74
|
-
process.exit( museumStatus )
|
|
75
|
-
} catch ( ex ) {
|
|
76
|
-
log( ex.stderr )
|
|
77
|
-
process.exit( museumStatus + 1 )
|
|
78
|
-
}
|
|
85
|
+
if ( args.noRegistry ) {
|
|
86
|
+
log( `${chalk.bold.yellow( '\nskipping the chart push to the artifact registry' )}` )
|
|
87
|
+
process.exit( museumStatus )
|
|
79
88
|
}
|
|
80
89
|
|
|
81
|
-
|
|
90
|
+
try {
|
|
91
|
+
log( chalk.green( ' ... pushing to the Artifact Registry' ) )
|
|
92
|
+
const registry = await shellCmd( `chart-to-registry --chart ${args.chart}` )
|
|
93
|
+
debug( { registry }, '<==chart-to-registry' )
|
|
94
|
+
process.exit( museumStatus )
|
|
95
|
+
} catch ( ex ) {
|
|
96
|
+
log( ex.stderr )
|
|
97
|
+
process.exit( museumStatus + 1 )
|
|
98
|
+
}
|