@leverege/build-tools 2.26.5 → 2.27.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.
Files changed (2) hide show
  1. package/package.json +6 -6
  2. package/src/helmup +33 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.26.5",
3
+ "version": "2.27.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -65,14 +65,14 @@
65
65
  "parse-gitignore": "^2.0.0",
66
66
  "readline-sync": "^1.4.10",
67
67
  "semver": "^7.3.8",
68
- "simple-git": "^3.16.0",
69
- "zx": "^7.1.1"
68
+ "simple-git": "^3.17.0",
69
+ "zx": "^7.2.0"
70
70
  },
71
71
  "devDependencies": {
72
- "@babel/cli": "^7.20.7",
73
- "@babel/core": "^7.20.12",
72
+ "@babel/cli": "^7.21.0",
73
+ "@babel/core": "^7.21.0",
74
74
  "@leverege/babel-preset-leverege-node": "^2.0.0",
75
75
  "@leverege/eslint-config-leverege": "^3.0.1",
76
- "npm": "^9.4.1"
76
+ "npm": "^9.6.1"
77
77
  }
78
78
  }
package/src/helmup CHANGED
@@ -21,7 +21,7 @@ PLATFORM=(
21
21
  scheduler
22
22
  transponder-bq
23
23
  transponder-rt
24
- transponder-postgres # deprecated
24
+ # transponder-postgres # deprecated
25
25
  transponder-tsdb
26
26
  )
27
27
 
@@ -110,16 +110,9 @@ function createNamespaceIfNeeded() {
110
110
 
111
111
  function bootstrapLocalSetup() {
112
112
  SERVICE="$1"
113
- [ -z "$1" ] && errorExit "bootstrapLocalSetup function requires a service name"
114
- ifPluggedIn $SERVICE && return # if it's already plugged in then go
115
-
116
- TOOLS_SRC="$(build-tools --reporoot)/src"
117
- SYSTEM_FILES="$(build-tools --reporoot)/src/system-charts"
113
+ [ -z "$SERVICE" ] && errorExit "bootstrapLocalSetup function requires a service name"
118
114
 
119
- SYSTEM_CHART="$SYSTEM_FILES/$SERVICE-local.yaml"
120
- [ ! -f "$SYSTEM_CHART" ] && errorExit "Missing $SERVICE chart => $(color y $SYSTEM_CHART)"
121
- SYSTEM_HUP="$SYSTEM_FILES/$SERVICE.hup"
122
- [ ! -f "$SYSTEM_HUP" ] && errorExit "Missing $SERVICE helmup script => $(color y $SYSTEM_HUP)"
115
+ ifPluggedIn $SERVICE && return # if it's already plugged in then go
123
116
 
124
117
  if [ ! -d "$SERVICE" ];
125
118
  then
@@ -142,14 +135,37 @@ MISSING_HELMUP_PLUGIN
142
135
  errorExit "Installaion of `color y $SERVICE` failed - exiting"
143
136
  fi
144
137
 
145
- if [ "$2" == "set-values-local" ];
138
+ TOOLS_SRC="$(build-tools --reporoot)/src"
139
+ SYSTEM_FILES="$(build-tools --reporoot)/src/system-charts"
140
+
141
+ case "$2" in
142
+ "set-values-local")
143
+ SYSTEM_CHART="$SYSTEM_FILES/$SERVICE-local.yaml"
144
+ TARGET_CHART="values-local.yaml"
145
+ ;;
146
+
147
+ "ovh-values-local")
148
+ SYSTEM_CHART="$SYSTEM_FILES/$SERVICE-local.yaml.ovh"
149
+ TARGET_CHART="$SERVICE-local.yaml.ovh"
150
+ echo "$SERVICE-local.yaml" > $SERVICE/.gitignore
151
+ ;;
152
+
153
+ *)
154
+ SYSTEM_CHART="$SYSTEM_FILES/$SERVICE-local.yaml"
155
+ TARGET_CHART="$SYSTEM_CHART"
156
+ touch $SERVICE/.nohelm
157
+ ;;
158
+ esac
159
+
160
+ if [ ! -f "$SYSTEM_CHART" ];
146
161
  then
147
- TARGET_CHART="values-local.yaml"
148
- else
149
- TARGET_CHART="$SERVICE-local.yaml"
150
- touch $SERVICE/.nohelm
162
+ rm -rf $SERVICE
163
+ errorExit "Missing $SERVICE chart => $(color y $SYSTEM_CHART)"
151
164
  fi
152
165
 
166
+ SYSTEM_HUP="$SYSTEM_FILES/$SERVICE.hup"
167
+ [ ! -f "$SYSTEM_HUP" ] && errorExit "Missing $SERVICE helmup script => $(color y $SYSTEM_HUP)"
168
+
153
169
  cp $SYSTEM_CHART $SERVICE/$TARGET_CHART
154
170
  cp $SYSTEM_HUP $SERVICE/helmup.plugin
155
171
  git add $SERVICE
@@ -234,7 +250,7 @@ ELASTIC_EXPORTER_CHART_MOD
234
250
  bootstrapLocalSetup prometheus set-values-local
235
251
 
236
252
  ## Install Grafana
237
- bootstrapLocalSetup grafana
253
+ bootstrapLocalSetup grafana ovh-values-local
238
254
 
239
255
  ## Clean up
240
256
  removeHelmRepo prometheus-community
@@ -703,7 +719,7 @@ function doInstall() {
703
719
  ;;
704
720
 
705
721
  "grafana")
706
- bootstrapLocalSetup grafana
722
+ bootstrapLocalSetup grafana ovh-values-local
707
723
  ;;
708
724
 
709
725
  "monitoring")