@leverege/build-tools 2.9.2 → 2.9.4

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.9.2",
3
+ "version": "2.9.4",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -60,7 +60,7 @@
60
60
  "command-line-args": "^5.2.1",
61
61
  "command-line-usage": "^6.1.1",
62
62
  "deepmerge": "^4.2.2",
63
- "dotenv": "^14.3.2",
63
+ "dotenv": "^16.0.0",
64
64
  "execa": "^5.1.1",
65
65
  "figlet": "^1.5.2",
66
66
  "glob": "^7.2.0",
@@ -76,11 +76,11 @@
76
76
  "simple-git": "^2.48.0"
77
77
  },
78
78
  "devDependencies": {
79
- "@babel/cli": "^7.17.0",
80
- "@babel/core": "^7.17.2",
79
+ "@babel/cli": "^7.17.6",
80
+ "@babel/core": "^7.17.5",
81
81
  "@babel/node": "^7.16.8",
82
82
  "@leverege/babel-preset-leverege-node": "^2.0.0",
83
83
  "@leverege/eslint-config-leverege": "^3.0.1",
84
- "npm": "^8.5.0"
84
+ "npm": "^8.5.2"
85
85
  }
86
86
  }
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: ./node_modules/.bin/c8 check-coverage --functions 70 --lines 70 --statements 70
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,31 +514,60 @@ 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 "Charts.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 || '' )"`
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 repo stable &> /dev/null # stable was deprecated
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
- IFS="/" read SERVICE CHARTVER <<< "$PARAM"
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
540
566
  [ ! -z "$CHARTVER" ] && CHARTVER="--version $CHARTVER"
541
567
 
568
+ # set the dry-run flag on what
569
+ [ "`basename $0`" == "helmwhat" ] && WHAT="--dry-run --debug"
570
+
542
571
  # If we're referencing a plugin then execute it and continue
543
572
  ifPluggedIn $SERVICE && continue
544
573
 
@@ -614,7 +643,7 @@ function doInstall() {
614
643
  transponder-*)
615
644
  # transponders use the same chart but different deployment name
616
645
  helm upgrade --install $SERVICE leverege/transponder \
617
- --values $SERVICE/values.yaml
646
+ --values $SERVICE/values.yaml $CHARTVER $WHAT
618
647
  ;;
619
648
 
620
649
  "traefik")
@@ -651,7 +680,6 @@ function doInstall() {
651
680
  MUSEUM=$(<${OVERRIDE})
652
681
  printf "\n$YELO_WARN Local chartmuseum name override from ${SERVICE} to ${MUSEUM}\n"
653
682
  fi
654
- [ "`basename $0`" == "helmwhat" ] && WHAT="--dry-run --debug"
655
683
  HELMUP="helm upgrade --install $SERVICE leverege/$MUSEUM -f $SERVICE/values.yaml $CHARTVER $WHAT"
656
684
  printf "Helming => `color g \"$HELMUP\"`\n" && $HELMUP
657
685
  SAVERR=$?