@leverege/build-tools 2.35.0-john.1 → 2.35.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.35.0-john.1",
3
+ "version": "2.35.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -57,7 +57,7 @@
57
57
  "command-line-usage": "^6.1.3",
58
58
  "deepmerge": "^4.3.1",
59
59
  "dotenv": "^16.3.1",
60
- "enquirer": "^2.3.6",
60
+ "enquirer": "^2.4.1",
61
61
  "execa": "^5.1.1",
62
62
  "get-bin-path": "^10.0.0",
63
63
  "glob": "^8.1.0",
@@ -75,6 +75,6 @@
75
75
  "@babel/core": "^7.22.9",
76
76
  "@leverege/babel-preset-leverege-node": "^2.0.0",
77
77
  "@leverege/eslint-config-leverege": "^3.0.1",
78
- "npm": "^9.8.0"
78
+ "npm": "^9.8.1"
79
79
  }
80
80
  }
package/src/bash-funcs CHANGED
@@ -137,7 +137,7 @@ function postToSlack() {
137
137
  local dts="`date +\"%c\"`"
138
138
  local slackURL="https://hooks.slack.com/services/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"
139
139
  local channel="#dev-ops-helm"
140
- local slackmsg="\n--- $running \`$GCP_PROJECT_ID\` => $USER / `node --version` @ $dts\n \`$toPost\`"
140
+ local slackmsg="\n--- $running by \`$USER\` in \`$GCP_PROJECT_ID\` @ $dts\n \`$toPost\`\n node `node --version` / `build-tools --version` / helm `helm version --short`\n"
141
141
 
142
142
  curl -X POST -H 'Content-type: application/json' \
143
143
  --data "{\"text\":\"$slackmsg\",\"channel\":\"$channel\"}" \
package/src/helmdn CHANGED
@@ -94,7 +94,6 @@ function annihilateVelero() {
94
94
  function helmDown() {
95
95
  local namespace=${2:-default}
96
96
  local helmdn="helm uninstall $1 -n $namespace"
97
- printf "Gonna=>[$helmdn]\n"
98
97
  eval $helmdn
99
98
  postToSlack $helmdn
100
99
  }
@@ -111,15 +110,15 @@ function doNuking() {
111
110
  ;;
112
111
 
113
112
  "elastic"|"elasticsearch")
114
- helm uninstall elasticsearch
113
+ helmDown elasticsearch
115
114
  ;;
116
115
 
117
116
  "estafette"|"preemptible-killer")
118
- helm uninstall -n estafette estafette-gke-preemptible-killer
117
+ helmDown estafette-gke-preemptible-killer estafette
119
118
  ;;
120
119
 
121
120
  "traefik")
122
- helm uninstall -n traefik traefik
121
+ helmDown traefik traefik
123
122
  ;;
124
123
 
125
124
  "monitoring")
@@ -158,7 +157,6 @@ NOGRESS
158
157
 
159
158
  *)
160
159
  helmDown $SERVICE "default"
161
- #helm -n default uninstall $SERVICE
162
160
  esac
163
161
  done
164
162
  }
package/src/helmup CHANGED
@@ -119,7 +119,7 @@ function bootstrapLocalSetup() {
119
119
  then
120
120
  mkdir $SERVICE
121
121
  else
122
- # If the service dir already exists but the nghelmup.plugin file is missing
122
+ # If the service dir already exists but the helmup.plugin file is missing
123
123
  # then this is most likely a legacy setup - for example, an older setup for
124
124
  # elasticsearch that only had an es-values.yaml file. Note that we cannot
125
125
  # get to this logic if the helmup.plugin file exists so no need to check
package/src/k8scale CHANGED
@@ -1,22 +1,13 @@
1
1
  #!/bin/bash
2
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
- }
3
+ # Load the standard helper functions
4
+ . `build-tools --bashfun`
15
5
 
16
6
  GITTOP=`git rev-parse --show-toplevel` && cd $GITTOP
17
7
 
18
8
  overwhelm
19
9
  [ $? -ne 0 ] && printf "\n\n***Aborting helmup...\n\n" && exit 1
10
+ GCP_PROJECT_ID="$(getProjectIdFromK8sContext)"
20
11
 
21
12
  REPLICAS=
22
13
  DIRECTION=$1 && shift
@@ -40,5 +31,6 @@ do
40
31
  kubectl scale --replicas=$REPLICAS deployment $SERVICE &>/dev/null
41
32
  [ $? -eq 1 ] && RESULTS="`color r FAILURE`"
42
33
  printf " $RESULTS => $SERVICE\n"
34
+ postToSlack "k8scale $DIRECTION $SERVICE"
43
35
  done
44
36
  printf "\n\n"