@leverege/build-tools 2.43.5 → 2.43.7
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 +3 -3
- package/src/Utils.mjs +111 -8
- package/src/bash-funcs +1 -0
- package/src/chart-to-registry.mjs +64 -11
- package/src/circleate.sh +2 -0
- package/src/dirty-git.sh +12 -5
- package/src/helm-charts/api-server/values-local.yaml +1 -1
- package/src/helm-charts/authz-server/values-local.yaml +2 -0
- package/src/helm-charts/db-curator-dh/values-local.yaml +11 -0
- package/src/helm-charts/grafana/helmup.plugin +1 -1
- package/src/helm-charts/messenger/values-local.yaml +1 -1
- package/src/helm-charts/overdose/values-local.yaml +18 -0
- package/src/helm-charts/redis/helmup.plugin +4 -5
- package/src/helm-charts/resource-server/values-local.yaml +1 -1
- package/src/helm-charts/traefik/helmup.plugin +1 -1
- package/src/helm-charts/transponder-bq/values-local.yaml +1 -1
- package/src/helm-charts/transponder-rt/values-local.yaml +1 -1
- package/src/helm-charts/transponder-tsdb/values-local.yaml +2 -2
- package/src/helmup.sh +4 -2
- package/src/pkgck.sh +1 -1
- package/src/send-to-slack.mjs +3 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.43.
|
|
3
|
+
"version": "2.43.7",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"ms": "^2.1.3",
|
|
65
65
|
"npm-registry-fetch": "^16.1.0",
|
|
66
66
|
"parse-gitignore": "^2.0.0",
|
|
67
|
-
"read-pkg": "^
|
|
67
|
+
"read-pkg": "^9.0.0",
|
|
68
68
|
"readline-sync": "^1.4.10",
|
|
69
69
|
"semver": "^7.5.4",
|
|
70
70
|
"simple-git": "^3.20.0",
|
|
@@ -72,6 +72,6 @@
|
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@leverege/eslint-config-leverege": "^4.2.0",
|
|
75
|
-
"npm": "^10.2.
|
|
75
|
+
"npm": "^10.2.3"
|
|
76
76
|
}
|
|
77
77
|
}
|
package/src/Utils.mjs
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
2
|
+
|
|
1
3
|
import chalk from 'chalk'
|
|
2
4
|
import { $ } from 'execa'
|
|
5
|
+
import YAML from 'js-yaml'
|
|
3
6
|
|
|
4
7
|
const debugEnabled = process.env.BUILD_TOOLS_DEBUG === '1'
|
|
5
8
|
|
|
6
9
|
/* eslint-disable no-console */
|
|
7
10
|
export const err = console.error
|
|
8
11
|
export const log = console.log
|
|
12
|
+
export const condir = ( obj, text = '' ) => {
|
|
13
|
+
console.log( `${chalk.yellow( '\n***DEBUG:' )} ${chalk.green( text )}` )
|
|
14
|
+
console.dir(
|
|
15
|
+
{ obj, },
|
|
16
|
+
{ depth : 8, colors : true },
|
|
17
|
+
)
|
|
18
|
+
}
|
|
9
19
|
export const debug = ( obj, text ) => {
|
|
10
|
-
if ( debugEnabled ) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{ depth : 8, colors : true }, )
|
|
16
|
-
}
|
|
20
|
+
if ( debugEnabled ) { condir( obj, text ) }
|
|
21
|
+
}
|
|
22
|
+
export const errorExit = ( error, opts = { errorCode : 1 } ) => {
|
|
23
|
+
console.error( `\n${chalk.red.bold( error )}\n` )
|
|
24
|
+
if ( opts?.errorCode ) { process.exit( opts.errorCode ) }
|
|
17
25
|
}
|
|
18
26
|
/* eslint-enable no-console */
|
|
19
27
|
|
|
@@ -30,7 +38,102 @@ export const shellCmd = async ( cmdstr, opts = {} ) => {
|
|
|
30
38
|
|
|
31
39
|
return results.stdout
|
|
32
40
|
} catch ( error ) {
|
|
33
|
-
debug( { error } )
|
|
41
|
+
debug( { error }, '<==shellCmd' )
|
|
42
|
+
throw error
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const getGcpSecret = async ( gcpProject, secretName, opts ) => {
|
|
47
|
+
const secretFetchCmd = `gcloud secrets versions access latest --project=${gcpProject} --secret=${secretName}`
|
|
48
|
+
let secretString
|
|
49
|
+
try {
|
|
50
|
+
secretString = await shellCmd( secretFetchCmd )
|
|
51
|
+
} catch ( error ) {
|
|
52
|
+
debug( { error }, '<==getGcpSecret' )
|
|
53
|
+
throw error
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if ( !opts?.isJSON ) { return secretString }
|
|
57
|
+
|
|
58
|
+
try {
|
|
59
|
+
const secretJSON = JSON.parse( secretString )
|
|
60
|
+
return secretJSON
|
|
61
|
+
} catch ( error ) {
|
|
62
|
+
debug( { error }, '<==getGcpSecret JSON.parse' )
|
|
63
|
+
throw error
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const getGitRootDirectory = async () => {
|
|
68
|
+
try {
|
|
69
|
+
const gitRoot = await shellCmd( 'git rev-parse --show-toplevel' )
|
|
70
|
+
debug( { gitRoot }, '<==getGitRootDirectory' )
|
|
71
|
+
return gitRoot
|
|
72
|
+
} catch ( error ) {
|
|
73
|
+
debug( { error }, '<==getGitRootDirectory' )
|
|
34
74
|
throw error
|
|
35
75
|
}
|
|
36
76
|
}
|
|
77
|
+
|
|
78
|
+
export const parseJsonFile = async ( jsonFile ) => {
|
|
79
|
+
/* eslint-disable security/detect-non-literal-fs-filename */
|
|
80
|
+
if ( existsSync( jsonFile ) ) {
|
|
81
|
+
try {
|
|
82
|
+
const json = JSON.parse( readFileSync( jsonFile, 'utf8' ) )
|
|
83
|
+
return json
|
|
84
|
+
} catch ( error ) {
|
|
85
|
+
throw new Error( `${error} in ${jsonFile}` )
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
throw new Error( `File ${jsonFile} does not exist` )
|
|
89
|
+
/* eslint-enable security/detect-non-literal-fs-filename */
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Parses the ./package.json file and verifies there is a properly formatted
|
|
93
|
+
// leverege.registry section present.
|
|
94
|
+
export const parsePackageJson = async ( packageFileName ) => {
|
|
95
|
+
const packageJson = await parseJsonFile( packageFileName )
|
|
96
|
+
|
|
97
|
+
const leveregeClauseError = `leverege.registry statement, it should
|
|
98
|
+
resemble something like:
|
|
99
|
+
|
|
100
|
+
"leverege": {
|
|
101
|
+
"registry": "us-docker.pkg.dev/leverege-registry/<REPO NAME>"
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
`
|
|
105
|
+
|
|
106
|
+
if ( !packageJson?.leverege?.registry ) {
|
|
107
|
+
errorExit( `Error: package.json is missing a proper ${leveregeClauseError}` )
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const artifacts = packageJson.leverege.registry.split( '/' )
|
|
111
|
+
if ( artifacts.length !== 3 ) {
|
|
112
|
+
errorExit( `Error: package.json has a malformed ${leveregeClauseError}` )
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
artifactRegistry : {
|
|
117
|
+
registry : packageJson.leverege.registry,
|
|
118
|
+
region : artifacts[0],
|
|
119
|
+
project : artifacts[1],
|
|
120
|
+
repository : artifacts[2],
|
|
121
|
+
},
|
|
122
|
+
...packageJson,
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const parseHelmChart = async ( helmroot ) => {
|
|
127
|
+
/* eslint-disable security/detect-non-literal-fs-filename */
|
|
128
|
+
const chartFiles = readdirSync( helmroot, { encoding : 'utf8', recursive : true } )
|
|
129
|
+
const chartYaml = YAML.load( readFileSync( `${helmroot}/Chart.yaml`, 'utf-8' ) )
|
|
130
|
+
const valuesYaml = YAML.load( readFileSync( `${helmroot}/values.yaml`, 'utf-8' ) )
|
|
131
|
+
/* eslint-enable security/detect-non-literal-fs-filename */
|
|
132
|
+
return ( {
|
|
133
|
+
files : chartFiles,
|
|
134
|
+
yaml : {
|
|
135
|
+
'Chart.yaml' : chartYaml,
|
|
136
|
+
'values.yaml' : valuesYaml
|
|
137
|
+
}
|
|
138
|
+
} )
|
|
139
|
+
}
|
package/src/bash-funcs
CHANGED
|
@@ -8,20 +8,37 @@ import commandLineArgs from 'command-line-args'
|
|
|
8
8
|
import commandLineUsage from 'command-line-usage'
|
|
9
9
|
import { lt as semverLt } from 'semver'
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
condir, debug,
|
|
13
|
+
errorExit,
|
|
14
|
+
log,
|
|
15
|
+
getGitRootDirectory,
|
|
16
|
+
parsePackageJson,
|
|
17
|
+
parseHelmChart,
|
|
18
|
+
shellCmd } from './Utils.mjs'
|
|
12
19
|
|
|
13
20
|
const commandLineOptions = [ // Use commandLineOptions to tie into the Usage statements
|
|
14
21
|
/* eslint-disable max-len */
|
|
15
22
|
{
|
|
16
23
|
name : 'project',
|
|
17
24
|
type : String,
|
|
18
|
-
|
|
25
|
+
defaultValue : process.env.HELM_CHART_REGISTRY || 'leverege-registry',
|
|
19
26
|
description : '{green the name of the google project containing the npmrc and slack config secrets (default leverege-registry)}',
|
|
20
27
|
},
|
|
28
|
+
{
|
|
29
|
+
name : 'region',
|
|
30
|
+
type : String,
|
|
31
|
+
defaultValue : 'us-docker.pkg.dev',
|
|
32
|
+
description : '{green the region of the artifact registry the chart will be pushed to (default us-docker.pkg.dev)}',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name : 'repository',
|
|
36
|
+
type : String,
|
|
37
|
+
description : '{green the target repository to receive the pushed chart}',
|
|
38
|
+
},
|
|
21
39
|
{
|
|
22
40
|
name : 'help',
|
|
23
41
|
type : Boolean,
|
|
24
|
-
default : false,
|
|
25
42
|
description : '{green display this help screen}',
|
|
26
43
|
},
|
|
27
44
|
/* eslint-enable max-len */
|
|
@@ -54,16 +71,52 @@ if ( args._unknown ) {
|
|
|
54
71
|
}
|
|
55
72
|
/* eslint-enable no-underscore-dangle */
|
|
56
73
|
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
const minNodejsVersion = '18.13.0'
|
|
74
|
+
const minNodejsVersion = '18.0.0'
|
|
60
75
|
if ( semverLt( process.version, minNodejsVersion ) ) {
|
|
61
|
-
|
|
62
|
-
process.exit( 1 )
|
|
76
|
+
errorExit( `\n***ERROR: must be running at least node ${minNodejsVersion}\n` )
|
|
63
77
|
}
|
|
64
78
|
|
|
65
|
-
|
|
66
|
-
|
|
79
|
+
log( { args }, chalk.yellow( '\n\n***WARNING: Under Construction' ) )
|
|
80
|
+
|
|
81
|
+
// gcloud auth print-access-token | helm registry login -u oauth2accesstoken \
|
|
82
|
+
// -p ${password} https://us-docker.pkg.dev
|
|
83
|
+
//
|
|
84
|
+
// Get the current access token and use it to login to the registry with helm.
|
|
85
|
+
try {
|
|
86
|
+
const accessToken = await shellCmd( 'gcloud auth print-access-token' )
|
|
87
|
+
const registryLoginCommand = `helm registry login -u oauth2accesstoken -p ${accessToken}`
|
|
88
|
+
|
|
89
|
+
const loginResult = await shellCmd( `${registryLoginCommand} https://${args.region}` ) // TODO: cmd line param
|
|
90
|
+
debug( { loginResult }, '<==registryLogin' )
|
|
91
|
+
} catch ( error ) {
|
|
92
|
+
errorExit( error )
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// First of all, fail if we are not in a git repository
|
|
96
|
+
let gitRoot
|
|
97
|
+
try {
|
|
98
|
+
gitRoot = await getGitRootDirectory()
|
|
99
|
+
} catch ( error ) {
|
|
100
|
+
errorExit( chalk.red.bold( error ), { errorCode : 5 } )
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Next, parse the package.json file looking for sections of interest
|
|
104
|
+
let packageJson
|
|
105
|
+
try {
|
|
106
|
+
packageJson = await parsePackageJson( './package.json' )
|
|
107
|
+
} catch ( error ) {
|
|
108
|
+
errorExit( error )
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// And then load up the helm chart too
|
|
112
|
+
let helmChart
|
|
113
|
+
try {
|
|
114
|
+
helmChart = await parseHelmChart( `${gitRoot}/helm` )
|
|
115
|
+
} catch ( error ) {
|
|
116
|
+
errorExit( error )
|
|
67
117
|
}
|
|
68
118
|
|
|
69
|
-
|
|
119
|
+
condir( { packageJson, helmChart }, '<==Parsed package and chart' )
|
|
120
|
+
|
|
121
|
+
// helm push chart-tarball oci://REGISTRY_NAME/REPOSITORY_NAME/charts/SERVICE
|
|
122
|
+
// helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/redis
|
package/src/circleate.sh
CHANGED
|
@@ -241,6 +241,7 @@ workflows:
|
|
|
241
241
|
requires:
|
|
242
242
|
- install
|
|
243
243
|
- coverage:
|
|
244
|
+
context: npm
|
|
244
245
|
requires:
|
|
245
246
|
- install
|
|
246
247
|
- docs:
|
|
@@ -413,6 +414,7 @@ workflows:
|
|
|
413
414
|
requires:
|
|
414
415
|
- install
|
|
415
416
|
- coverage:
|
|
417
|
+
context: npm
|
|
416
418
|
requires:
|
|
417
419
|
- install
|
|
418
420
|
- docs:
|
package/src/dirty-git.sh
CHANGED
|
@@ -8,9 +8,9 @@ CLEAN="\e[32m✔\e[0m"
|
|
|
8
8
|
DIRTY="\e[31m✘\e[0m"
|
|
9
9
|
STASH="\e[33;44m$\e[0m"
|
|
10
10
|
AHEAD="\e[34;42m!\e[0m"
|
|
11
|
-
#NOHED="\e[31m✖\e[0m"
|
|
12
11
|
NOHED="\e[31;43m⚑\e[0m"
|
|
13
12
|
LOCKD="\e[35m\e[0m"
|
|
13
|
+
ELAS7="\e[33m7\e[0m"
|
|
14
14
|
|
|
15
15
|
clear
|
|
16
16
|
printf "${CLEAN} clean ${DIRTY} dirty ${STASH} stashed ${AHEAD} unpushed ${NOHED} no remote ${LOCKD} locked\n\n"
|
|
@@ -22,14 +22,21 @@ do
|
|
|
22
22
|
[[ `git status --porcelain` ]] && status="$DIRTY" || status="$CLEAN"
|
|
23
23
|
scount=`git stash list | wc -l`
|
|
24
24
|
[ $scount -gt 0 ] && stash="\e[33;44m$\e[0m" || stash=" "
|
|
25
|
-
ahead=`git rev-
|
|
26
|
-
if [ -
|
|
25
|
+
ahead=`git rev-parse --abbrev-ref $branch@{upstream} 2>/dev/null` # check on remote first
|
|
26
|
+
if [ $? -gt 0 ];
|
|
27
27
|
then
|
|
28
28
|
ahead="$NOHED" # "✖" # "❓"
|
|
29
29
|
else
|
|
30
|
-
|
|
30
|
+
ahead=`git rev-list FETCH_HEAD..HEAD --count 2>/dev/null`
|
|
31
|
+
if [ -z "$ahead" ];
|
|
32
|
+
then
|
|
33
|
+
ahead="$NOHED" # "✖" # "❓"
|
|
34
|
+
else
|
|
35
|
+
[ $ahead -gt 0 ] && ahead="$AHEAD" || ahead=" "
|
|
36
|
+
fi
|
|
31
37
|
fi
|
|
32
38
|
[ -f "Versions.json" ] && locked="$LOCKD" || locked=" "
|
|
39
|
+
[ ! -d "elasticsearch8" ] && elastic="$ELAS7" || elastic=" "
|
|
33
40
|
cd - &>/dev/null
|
|
34
|
-
printf "${status} %-28s ${stash}${ahead}${locked} %s\n" $dir $branch
|
|
41
|
+
printf "${status} %-28s ${stash}${ahead}${locked}${elastic} %s\n" $dir $branch
|
|
35
42
|
done
|
|
@@ -4,7 +4,7 @@ showInstalling "Grafana"
|
|
|
4
4
|
|
|
5
5
|
addHelmRepo grafana https://grafana.github.io/helm-charts
|
|
6
6
|
|
|
7
|
-
[ -z "$GRAFANA_CHART_VERSION" ] && GRAFANA_CHART_VERSION="
|
|
7
|
+
[ -z "$GRAFANA_CHART_VERSION" ] && GRAFANA_CHART_VERSION="7"
|
|
8
8
|
helm upgrade --install grafana grafana/grafana \
|
|
9
9
|
--namespace monitoring --create-namespace \
|
|
10
10
|
--values grafana/grafana-local.yaml \
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
image:
|
|
2
|
+
tag: # 1.2.1
|
|
3
|
+
|
|
4
|
+
config:
|
|
5
|
+
LOG_CONFIG: '{"type":"pino","level":"info"}'
|
|
6
|
+
|
|
7
|
+
resources:
|
|
8
|
+
limits:
|
|
9
|
+
cpu: 500m
|
|
10
|
+
memory: 1024Mi
|
|
11
|
+
requests:
|
|
12
|
+
cpu: 500m
|
|
13
|
+
memory: 1024Mi
|
|
14
|
+
|
|
15
|
+
autoscaling:
|
|
16
|
+
minReplicas: 6
|
|
17
|
+
maxReplicas: 16
|
|
18
|
+
averageCPU: 75
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
showInstalling "Redis"
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
OCI_CHART="oci://registry-1.docker.io/bitnamicharts/redis"
|
|
6
6
|
|
|
7
|
-
[ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="18"
|
|
8
|
-
|
|
7
|
+
[ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="18.3.1"
|
|
8
|
+
|
|
9
|
+
helm upgrade --install redis $OCI_CHART \
|
|
9
10
|
--values redis/redis-local.yaml \
|
|
10
11
|
--version $REDIS_CHART_VERSION $HELM_WHAT
|
|
11
|
-
|
|
12
|
-
removeHelmRepo bitnami
|
|
@@ -6,7 +6,7 @@ TRAEFIK_NAMESPACE="traefik"
|
|
|
6
6
|
|
|
7
7
|
addHelmRepo traefik https://helm.traefik.io/traefik
|
|
8
8
|
|
|
9
|
-
[ -z "$TRAEFIK_CHART_VERSION" ] && TRAEFIK_CHART_VERSION="
|
|
9
|
+
[ -z "$TRAEFIK_CHART_VERSION" ] && TRAEFIK_CHART_VERSION="25"
|
|
10
10
|
helm upgrade --install traefik traefik/traefik \
|
|
11
11
|
--namespace $TRAEFIK_NAMESPACE --create-namespace \
|
|
12
12
|
--values traefik/traefik-local.yaml \
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
nameOverride: transponder-tsdb
|
|
8
8
|
|
|
9
9
|
image:
|
|
10
|
-
tag: # v5.0.
|
|
10
|
+
tag: # v5.0.3
|
|
11
11
|
|
|
12
12
|
config:
|
|
13
13
|
TRANSPONDER_RUN_MODE: "timescale"
|
|
@@ -15,7 +15,7 @@ config:
|
|
|
15
15
|
|
|
16
16
|
TRANSPORT_CONFIG: '{
|
|
17
17
|
"type": "pubsub",
|
|
18
|
-
"projectId": "OVH:<
|
|
18
|
+
"projectId": "OVH:<PROJECT_ID>",
|
|
19
19
|
"publisher": {
|
|
20
20
|
"batching": {
|
|
21
21
|
"maxMilliseconds": 0,
|
package/src/helmup.sh
CHANGED
|
@@ -31,8 +31,10 @@ PLATFORM=(
|
|
|
31
31
|
|
|
32
32
|
AUXILIARY=(
|
|
33
33
|
geotile-server
|
|
34
|
+
overdose
|
|
34
35
|
pubsub-pulse
|
|
35
36
|
push-notifier
|
|
37
|
+
pusher
|
|
36
38
|
vin-decoder-server
|
|
37
39
|
)
|
|
38
40
|
|
|
@@ -690,8 +692,8 @@ CATBACKUP
|
|
|
690
692
|
installDefaultConfigs
|
|
691
693
|
;;
|
|
692
694
|
|
|
693
|
-
db-curator
|
|
694
|
-
# db-curator
|
|
695
|
+
db-curator-dh)
|
|
696
|
+
# db-curator-dh is a variant of db-curator with diff controlled in values-local.yaml
|
|
695
697
|
HELMUP="helm upgrade --install $SERVICE leverege/db-curator --values $SERVICE/values.yaml $CHARTVER $HELM_WHAT"
|
|
696
698
|
doHelmup "$HELMUP"
|
|
697
699
|
;;
|
package/src/pkgck.sh
CHANGED
|
@@ -54,7 +54,7 @@ check_eslint () {
|
|
|
54
54
|
|
|
55
55
|
check_license () {
|
|
56
56
|
local C_stat=$(meh)
|
|
57
|
-
local lic="`node -p \"require('./package.json').scripts.licenseCheck
|
|
57
|
+
local lic="`node -p \"require('./package.json').scripts.licenseCheck == undefined\"`"
|
|
58
58
|
[ $lic == true ] && C_stat=$(good)
|
|
59
59
|
printf $C_stat
|
|
60
60
|
}
|
package/src/send-to-slack.mjs
CHANGED
|
@@ -42,7 +42,6 @@ const slackSendOptions = [ // Use slackSendOptions to tie into the Usage stateme
|
|
|
42
42
|
default : false,
|
|
43
43
|
description : '{green display this help screen}',
|
|
44
44
|
},
|
|
45
|
-
/* eslint-enable max-len */
|
|
46
45
|
]
|
|
47
46
|
|
|
48
47
|
const sections = [
|
|
@@ -100,14 +99,14 @@ try {
|
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
// slack out the details to the configured channel
|
|
103
|
-
const account = await shellCmd( 'gcloud config get account' )
|
|
104
102
|
const slackData = {
|
|
105
|
-
text : args.message.replace(
|
|
103
|
+
text : args.message.replace( /^"|"$/g, '' ), // strip pesky leading/trailing "
|
|
106
104
|
channel : slackConfig.channel,
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
if ( process.env.BUILD_TOOLS_DEBUG || args.dryRun ) {
|
|
110
|
-
|
|
108
|
+
const account = await shellCmd( 'gcloud config get account' )
|
|
109
|
+
log( { account, slackConfig, slackData }, '<==Slack skipped' )
|
|
111
110
|
} else {
|
|
112
111
|
try {
|
|
113
112
|
const fetchStatus = await fetch( slackConfig.url, {
|