@leverege/build-tools 2.9.3 → 2.9.5
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/lib/server/overwhelm.js +9 -0
- package/lib/server/repo-init/config.tgz +0 -0
- package/lib/web/overwhelm.js +9 -0
- package/package.json +5 -6
- package/src/circleate +1 -1
- package/src/helmup +39 -13
- package/src/overwhelm.js +9 -0
- package/src/anchor +0 -41
package/lib/server/overwhelm.js
CHANGED
|
@@ -76,6 +76,15 @@ const context = args.context || gitBranch;
|
|
|
76
76
|
if (context === 'master') {
|
|
77
77
|
console.log('***ERROR: master context is forbidden; change to a different branch\n\n');
|
|
78
78
|
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (!fs.existsSync('overwhelm.yaml')) {
|
|
82
|
+
console.log(chalk.red.bold(`
|
|
83
|
+
|
|
84
|
+
***ERROR overwhelm => missing the overwhelm.yaml file - this command expects
|
|
85
|
+
to execute from within a platform-k8s branch
|
|
86
|
+
`));
|
|
87
|
+
process.exit(1);
|
|
79
88
|
} // Load the default values and then overlay with the project specific yaml
|
|
80
89
|
// values. This supports the notion of this type of approach in the
|
|
81
90
|
// overwhelm yaml settings:
|
|
Binary file
|
package/lib/web/overwhelm.js
CHANGED
|
@@ -76,6 +76,15 @@ const context = args.context || gitBranch;
|
|
|
76
76
|
if (context === 'master') {
|
|
77
77
|
console.log('***ERROR: master context is forbidden; change to a different branch\n\n');
|
|
78
78
|
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (!fs.existsSync('overwhelm.yaml')) {
|
|
82
|
+
console.log(chalk.red.bold(`
|
|
83
|
+
|
|
84
|
+
***ERROR overwhelm => missing the overwhelm.yaml file - this command expects
|
|
85
|
+
to execute from within a platform-k8s branch
|
|
86
|
+
`));
|
|
87
|
+
process.exit(1);
|
|
79
88
|
} // Load the default values and then overlay with the project specific yaml
|
|
80
89
|
// values. This supports the notion of this type of approach in the
|
|
81
90
|
// overwhelm yaml settings:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.5",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
21
21
|
},
|
|
22
22
|
"bin": {
|
|
23
|
-
"anchor": "src/anchor",
|
|
24
23
|
"build-tools": "src/build-tools.js",
|
|
25
24
|
"circleate": "src/circleate",
|
|
26
25
|
"decrypt-secrets": "src/decrypt-secrets",
|
|
@@ -60,7 +59,7 @@
|
|
|
60
59
|
"command-line-args": "^5.2.1",
|
|
61
60
|
"command-line-usage": "^6.1.1",
|
|
62
61
|
"deepmerge": "^4.2.2",
|
|
63
|
-
"dotenv": "^
|
|
62
|
+
"dotenv": "^16.0.0",
|
|
64
63
|
"execa": "^5.1.1",
|
|
65
64
|
"figlet": "^1.5.2",
|
|
66
65
|
"glob": "^7.2.0",
|
|
@@ -76,11 +75,11 @@
|
|
|
76
75
|
"simple-git": "^2.48.0"
|
|
77
76
|
},
|
|
78
77
|
"devDependencies": {
|
|
79
|
-
"@babel/cli": "^7.17.
|
|
80
|
-
"@babel/core": "^7.17.
|
|
78
|
+
"@babel/cli": "^7.17.6",
|
|
79
|
+
"@babel/core": "^7.17.5",
|
|
81
80
|
"@babel/node": "^7.16.8",
|
|
82
81
|
"@leverege/babel-preset-leverege-node": "^2.0.0",
|
|
83
82
|
"@leverege/eslint-config-leverege": "^3.0.1",
|
|
84
|
-
"npm": "^8.5.
|
|
83
|
+
"npm": "^8.5.2"
|
|
85
84
|
}
|
|
86
85
|
}
|
package/src/circleate
CHANGED
|
@@ -382,7 +382,7 @@ jobs:
|
|
|
382
382
|
|
|
383
383
|
- run:
|
|
384
384
|
name: Check if coverage meets at least 70%
|
|
385
|
-
command:
|
|
385
|
+
command: npx c8 check-coverage --functions 70 --lines 70 --statements 70
|
|
386
386
|
|
|
387
387
|
- store_artifacts:
|
|
388
388
|
path: coverage
|
package/src/helmup
CHANGED
|
@@ -514,26 +514,52 @@ PLUGIN_NOEXEC
|
|
|
514
514
|
return 0
|
|
515
515
|
}
|
|
516
516
|
|
|
517
|
+
function getServiceAndChartVersion() {
|
|
518
|
+
|
|
519
|
+
# Allows chart version from command line via <deployment>/<x.y.z>
|
|
520
|
+
IFS="/" read SERVICE CHARTVER <<< "$1"
|
|
521
|
+
|
|
522
|
+
# Allows chart version as <deployment>/Chart-x.y.z*>
|
|
523
|
+
[ ! -z "$CHARTVER" ] && return # service and chart version from CLI
|
|
524
|
+
|
|
525
|
+
# force the move away from the old approach
|
|
526
|
+
LCL_CHART=`compgen -G $SERVICE/Chart-?*.?*.?*` &>/dev/null
|
|
527
|
+
if [ ! -z "$LCL_CHART" ];
|
|
528
|
+
then
|
|
529
|
+
CHARTVER=${LCL_CHART#*/Chart-}
|
|
530
|
+
cat<<DEPRECATED_CHART
|
|
531
|
+
$YELO_WARN The use of $SERVICE/$LCL_CHART to lock the chart version has
|
|
532
|
+
been deprecated. Create a top level `color g "Versions.json"` file instead:
|
|
533
|
+
|
|
534
|
+
{
|
|
535
|
+
"scheduler" : "3.6.1",
|
|
536
|
+
"$SERVICE" : "$CHARTVER"
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
DEPRECATED_CHART
|
|
540
|
+
exit 1
|
|
541
|
+
fi
|
|
542
|
+
|
|
543
|
+
# check for the top level Charts.json file
|
|
544
|
+
local VERSIONS="./Versions.json"
|
|
545
|
+
if [ -f "$VERSIONS" ];
|
|
546
|
+
then
|
|
547
|
+
CHARTVER=`node -e "charts=require('$VERSIONS');console.log( charts['$SERVICE'].chart || '' )"&>/dev/null`
|
|
548
|
+
fi
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
# not a fan of global vars but bash forced me to - set by getServiceAndChartVersion
|
|
552
|
+
SERVICE=
|
|
553
|
+
CHARTVER=
|
|
517
554
|
function doInstall() {
|
|
518
555
|
|
|
519
|
-
helm remove
|
|
556
|
+
helm repo remove stable &> /dev/null # stable was deprecated
|
|
520
557
|
helm repo update &> /dev/null
|
|
521
558
|
|
|
522
559
|
for PARAM in "$@";
|
|
523
560
|
do
|
|
524
561
|
# Allows chart version from command line via <deployment>/<x.y.z>
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
# Allows chart version as <deployment>/Chart-x.y.z*>
|
|
528
|
-
if [ -z "$CHARTVER" ];
|
|
529
|
-
then
|
|
530
|
-
LCL_CHART=`compgen -G $SERVICE/Chart-?*.?*.?*` &>/dev/null
|
|
531
|
-
if [ ! -z "$LCL_CHART" ];
|
|
532
|
-
then
|
|
533
|
-
CHARTVER=${LCL_CHART#*/Chart-}
|
|
534
|
-
printf "\n$YELO_WARN Chart version controlled by => `color y $LCL_CHART`\n"
|
|
535
|
-
fi
|
|
536
|
-
fi
|
|
562
|
+
getServiceAndChartVersion "$PARAM"
|
|
537
563
|
#printf "SVC=[$SERVICE] CHT=[$CHARTVER]\n"
|
|
538
564
|
|
|
539
565
|
# slap additional helm syntax in there if the version is set
|
package/src/overwhelm.js
CHANGED
|
@@ -39,6 +39,15 @@ if ( context === 'master' ) {
|
|
|
39
39
|
process.exit( 1 )
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
if ( !fs.existsSync( 'overwhelm.yaml' ) ) {
|
|
43
|
+
console.log( chalk.red.bold( `
|
|
44
|
+
|
|
45
|
+
***ERROR overwhelm => missing the overwhelm.yaml file - this command expects
|
|
46
|
+
to execute from within a platform-k8s branch
|
|
47
|
+
` ) )
|
|
48
|
+
process.exit( 1 )
|
|
49
|
+
}
|
|
50
|
+
|
|
42
51
|
// Load the default values and then overlay with the project specific yaml
|
|
43
52
|
// values. This supports the notion of this type of approach in the
|
|
44
53
|
// overwhelm yaml settings:
|
package/src/anchor
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Load the standard helper functions
|
|
4
|
-
. `build-tools --bashfun`
|
|
5
|
-
|
|
6
|
-
if [ -z "$1" ] || [ -z "$2" ];
|
|
7
|
-
then
|
|
8
|
-
cat<<USAGE
|
|
9
|
-
|
|
10
|
-
$(color g "Usage: anchor <service name> <chart version>\n")
|
|
11
|
-
|
|
12
|
-
USAGE
|
|
13
|
-
exit 1
|
|
14
|
-
fi
|
|
15
|
-
|
|
16
|
-
SERVICE=$1
|
|
17
|
-
VERSION=$2
|
|
18
|
-
ANCHOR="${SERVICE}/Chart-${VERSION}"
|
|
19
|
-
|
|
20
|
-
if compgen -G "${SERVICE}/Chart-*" > /dev/null ;
|
|
21
|
-
then
|
|
22
|
-
cat<<ALREADY_ANCHORED
|
|
23
|
-
|
|
24
|
-
$(color r "$SERVICE is already anchored")
|
|
25
|
-
$(color y "Go remove the existing anchor from ${SERVICE} and try again")
|
|
26
|
-
|
|
27
|
-
`/bin/ls ${SERVICE}/Chart*`
|
|
28
|
-
|
|
29
|
-
ALREADY_ANCHORED
|
|
30
|
-
exit 1
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
printf "Locking $SERVICE chart version at $VERSION\n"
|
|
34
|
-
touch ${ANCHOR}
|
|
35
|
-
|
|
36
|
-
if [ -f "${ANCHOR}" ];
|
|
37
|
-
then
|
|
38
|
-
printf "Service locked with creation of ${ANCHOR}\n"
|
|
39
|
-
else
|
|
40
|
-
printf "***ERROR: failed to create anchor ${ANCHOR}\n"
|
|
41
|
-
fi
|