@leverege/build-tools 2.50.12 → 2.50.13

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/k8scale.sh +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.50.12",
3
+ "version": "2.50.13",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
package/src/k8scale.sh CHANGED
@@ -19,8 +19,11 @@ case $DIRECTION in
19
19
  REPLICAS=0
20
20
  DIRECTION=down
21
21
  ;;
22
+ roll)
23
+ DIRECTION=roll
24
+ ;;
22
25
  *)
23
- printf "Usage: `color g 'k8scale <up|dn|down> [deployment-list]'`\n\n" && exit 1
26
+ printf "Usage: `color g 'k8scale <up|dn|down|roll> [deployment-list]'`\n\n" && exit 1
24
27
  esac
25
28
 
26
29
  printf " scaled => `color g $DIRECTION`\n\n"
@@ -28,7 +31,12 @@ for DEPLOYMENT in "$@";
28
31
  do
29
32
  IFS="/" read SERVICE <<< "$DEPLOYMENT" # strip trailing /
30
33
  RESULTS="`color g SUCCESS`"
31
- kubectl scale --replicas=$REPLICAS deployment $SERVICE &>/dev/null
34
+ if [ "$DIRECTION" == "roll" ];
35
+ then
36
+ kubectl rollout restart deployment $SERVICE &> $DEVNULL
37
+ else
38
+ kubectl scale --replicas=$REPLICAS deployment $SERVICE &> $DEVNULL
39
+ fi
32
40
  [ $? -eq 1 ] && RESULTS="`color r FAILURE`"
33
41
  printf " $RESULTS => $SERVICE\n"
34
42
  sendToSlack "k8scale $DIRECTION $SERVICE"