@leverege/build-tools 2.43.0 → 2.43.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.43.
|
|
3
|
+
"version": "2.43.2",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"bin": {
|
|
16
16
|
"build-tools": "src/build-tools.mjs",
|
|
17
|
+
"chart-to-registry": "src/chart-to-registry.mjs",
|
|
17
18
|
"circleate": "src/circleate.sh",
|
|
18
19
|
"decrypt-secrets": "src/decrypt-secrets.sh",
|
|
19
20
|
"dirty-git": "src/dirty-git.sh",
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
* chart-to-registry will...
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import chalk from 'chalk'
|
|
7
|
+
import commandLineArgs from 'command-line-args'
|
|
8
|
+
import commandLineUsage from 'command-line-usage'
|
|
9
|
+
import ms from 'ms'
|
|
10
|
+
import { lt as semverLt } from 'semver'
|
|
11
|
+
|
|
12
|
+
import { debug, log, shellCmd } from './Utils.mjs'
|
|
13
|
+
|
|
14
|
+
const commandLineOptions = [ // Use commandLineOptions to tie into the Usage statements
|
|
15
|
+
/* eslint-disable max-len */
|
|
16
|
+
{
|
|
17
|
+
name : 'project',
|
|
18
|
+
type : String,
|
|
19
|
+
default : false,
|
|
20
|
+
description : '{green the name of the google project containing the npmrc and slack config secrets (default leverege-registry)}',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name : 'help',
|
|
24
|
+
type : Boolean,
|
|
25
|
+
default : false,
|
|
26
|
+
description : '{green display this help screen}',
|
|
27
|
+
},
|
|
28
|
+
/* eslint-enable max-len */
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
const sections = [
|
|
32
|
+
{
|
|
33
|
+
header : 'Leverege Helm Chart to Artifact Registry',
|
|
34
|
+
content : `{green This tool helps ...
|
|
35
|
+
... multi-line helm.}`
|
|
36
|
+
},
|
|
37
|
+
{ header : 'Options',
|
|
38
|
+
optionList : commandLineOptions,
|
|
39
|
+
},
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
const args = commandLineArgs( commandLineOptions, { camelCase : true, partial : true } )
|
|
43
|
+
const usage = commandLineUsage( sections )
|
|
44
|
+
|
|
45
|
+
if ( args.help ) {
|
|
46
|
+
log( usage )
|
|
47
|
+
process.exit( 0 )
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* eslint-disable no-underscore-dangle */
|
|
51
|
+
if ( args._unknown ) {
|
|
52
|
+
log( usage )
|
|
53
|
+
log( `\nUnrecognized argument [${chalk.bold.red( args._unknown )}]\n` )
|
|
54
|
+
process.exit( 1 )
|
|
55
|
+
}
|
|
56
|
+
/* eslint-enable no-underscore-dangle */
|
|
57
|
+
|
|
58
|
+
const gcpProject = args.project ? args.project : process.env.HELM_CHART_REGISTRY || 'leverege-registry'
|
|
59
|
+
|
|
60
|
+
if ( semverLt( process.version, '18.0.0' ) ) {
|
|
61
|
+
log( chalk.red( '\n\n***ERROR: must be running at least node 18\n' ) )
|
|
62
|
+
process.exit( 1 )
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const getGcpSecretCommand = ( secretName ) => {
|
|
66
|
+
return `gcloud secrets versions access latest --project=${gcpProject} --secret=${secretName}`
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
log( chalk.yellow( '\n\n***WARNING: Under Construction' ) )
|
|
@@ -7,10 +7,11 @@ LOCAL_ES_VALUES="elasticsearch8/elasticsearch-local-dev.yaml"
|
|
|
7
7
|
[ ! -f "$LOCAL_ES_VALUES" ] && exitOnError 1 "Missing the local ES config file => `color y $LOCAL_ES_VALUES`"
|
|
8
8
|
|
|
9
9
|
addBitnamiRepo latest
|
|
10
|
+
[ -z "$ELASTIC_CHART_VERSION" ] && ELASTIC_CHART_VERSION="19"
|
|
10
11
|
helm upgrade --install elasticsearch8 bitnami/elasticsearch \
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
--namespace elastic --create-namespace \
|
|
13
|
+
--values $LOCAL_ES_VALUES \
|
|
14
|
+
--version $ELASTIC_CHART_VERSION $HELM_WHAT
|
|
14
15
|
|
|
15
16
|
removeHelmRepo bitnami
|
|
16
17
|
|