@leverege/build-tools 2.3.2 → 2.4.0

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.
@@ -80,7 +80,7 @@ var Packleator = /*#__PURE__*/function () {
80
80
 
81
81
  var args = options.args;
82
82
  this.privatePackages = new Set();
83
- this.args = args ? _objectSpread({}, args, {
83
+ this.args = args ? _objectSpread(_objectSpread({}, args), {}, {
84
84
  output: args.output.substr(-1) === '/' ? args.output.substr(0, args.output.length) : args.output
85
85
  }) : {}; // args || {}
86
86
 
@@ -125,7 +125,7 @@ function _main() {
125
125
  break;
126
126
 
127
127
  case 4:
128
- packleator = new Packleator(_objectSpread({}, defaultConfig, {
128
+ packleator = new Packleator(_objectSpread(_objectSpread({}, defaultConfig), {}, {
129
129
  args: args
130
130
  }));
131
131
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.3.2",
3
+ "version": "2.4.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,6 +28,7 @@
28
28
  "helminit-dp": "src/helminit-dp",
29
29
  "helminit-scaler": "src/helminit-scaler",
30
30
  "helmup": "src/helmup",
31
+ "k8scale": "k8scale",
31
32
  "k8x": "src/k8x",
32
33
  "npm-link": "src/npm-link",
33
34
  "npm-unlink": "src/npm-unlink",
package/src/helmup CHANGED
@@ -429,6 +429,7 @@ function doInstall() {
429
429
  "postgres"|"postgresql")
430
430
  helm repo add bitnami https://charts.bitnami.com/bitnami
431
431
  helm upgrade --install postgres bitnami/postgresql -f postgres/postgres-values.yaml --version 8.9.6
432
+ ;;
432
433
 
433
434
  "redis")
434
435
  # https://github.com/helm/charts/tree/master/stable/redis
package/src/husky-run ADDED
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+
3
+ printf "\n***** Running Husky Pre-Checks *****\n\n"
4
+
5
+ sleep 3
6
+ exit 1
package/src/k8scale ADDED
@@ -0,0 +1,44 @@
1
+ #!/bin/bash
2
+
3
+ # Simple ANSI color coded string generator.
4
+ function color() {
5
+ local color=
6
+ case "$1" in
7
+ 'g') color="92m" ;; # green
8
+ 'c') color="96m" ;; # lt blue
9
+ 'y') color="93m" ;; # yellow
10
+ 'r') color="91m" ;; # red
11
+ 'toast') color="1;3;7;91;103;5m" ;;
12
+ esac
13
+ printf "\e[$color$2\e[0m"
14
+ }
15
+
16
+ GITTOP=`git rev-parse --show-toplevel` && cd $GITTOP
17
+
18
+ overwhelm
19
+ [ $? -ne 0 ] && printf "\n\n***Aborting helmup...\n\n" && exit 1
20
+
21
+ REPLICAS=
22
+ DIRECTION=$1 && shift
23
+ case $DIRECTION in
24
+ up)
25
+ REPLICAS=1
26
+ ;;
27
+ dn|down)
28
+ REPLICAS=0
29
+ DIRECTION=down
30
+ ;;
31
+ *)
32
+ printf "Usage: `color g 'k8scale <up|dn|down> [deployment-list]'`\n\n" && exit 1
33
+ esac
34
+
35
+ printf " scaled => `color g $DIRECTION`\n\n"
36
+ for DEPLOYMENT in "$@";
37
+ do
38
+ IFS="/" read SERVICE <<< "$DEPLOYMENT" # strip trailing /
39
+ RESULTS="`color g SUCCESS`"
40
+ kubectl scale --replicas=$REPLICAS deployment $SERVICE &>/dev/null
41
+ [ $? -eq 1 ] && RESULTS="`color r FAILURE`"
42
+ printf " $RESULTS => $SERVICE\n"
43
+ done
44
+ printf "\n\n"