@leverege/build-tools 2.5.3 → 2.5.5

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
@@ -211,7 +211,7 @@ class Gitter {
211
211
  console.log(chalk.keyword('orange').bold(`
212
212
  The repository is now configured with the initial commit and a development
213
213
  branch. Since you selected to skip the creation of the remote hosted repository
214
- it is up to you to complete those step manually.`));
214
+ it is up to you to complete those steps manually.`));
215
215
  return;
216
216
  }
217
217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.5.3",
3
+ "version": "2.5.5",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -60,18 +60,18 @@
60
60
  "inquirer": "^7.3.3",
61
61
  "js-yaml": "^3.14.0",
62
62
  "ncp": "^2.0.0",
63
- "npm-check-updates": "^7.0.3",
64
- "npm-registry-fetch": "^8.1.3",
65
- "open": "^7.1.0",
66
- "ora": "^4.0.5",
63
+ "npm-check-updates": "^7.1.1",
64
+ "npm-registry-fetch": "^8.1.4",
65
+ "open": "^7.2.0",
66
+ "ora": "^5.0.0",
67
67
  "parse-gitignore": "^1.0.1",
68
68
  "readline-sync": "^1.4.10",
69
69
  "semver": "^7.3.2",
70
- "simple-git": "^2.15.0"
70
+ "simple-git": "^2.20.1"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@babel/cli": "^7.10.5",
74
- "@babel/core": "^7.11.1",
74
+ "@babel/core": "^7.11.4",
75
75
  "@babel/node": "^7.10.5",
76
76
  "@leverege/babel-preset-leverege-node": "^1.1.0",
77
77
  "@leverege/eslint-config-leverege": "^2.0.10"
package/src/helmdn CHANGED
@@ -66,7 +66,7 @@ cd $GITTOP
66
66
  npm run ahoy
67
67
  [ $? -ne 0 ] && printf "\n\n***Aborting helmup...\n\n" && exit 1
68
68
 
69
- helm repo update && helm search chartmuseum
69
+ helm repo update # old helm2 => helm search chartmuseum
70
70
 
71
71
  function doNuking() {
72
72
 
package/src/helmup CHANGED
@@ -149,11 +149,45 @@ function installMonitoringCharts(){
149
149
 
150
150
  ## Installing stackdriver exporter in GKE
151
151
  if [[ "$IS_GKE" = true ]]; then
152
+ # Check SA creation
153
+ kubectl get sa -n monitoring stackdriver-exporter
154
+ if [[ $? -eq 1 ]]; then
155
+ # Create Kubernetes SA
156
+ printf "\n*** Creating stackdriver-exporter SA ***\n\n"
157
+ kubectl create sa -n monitoring stackdriver-exporter
158
+
159
+ # Detect Project ID
160
+ currContext=`kubectl config current-context`
161
+
162
+ IFS='_'
163
+ read -ra ADDR <<< "$currContext"
164
+
165
+ GCP_PROJECT_ID=${ADDR[1]} # project id is the second string split by _
166
+
167
+ # Create GCP SA and bind policies
168
+ printf "\n*** Creating GCP SA with monitoring/viewer ***\n\n"
169
+ gcloud iam service-accounts create stackdriver-exporter --project "$GCP_PROJECT_ID"
170
+
171
+ gcloud projects add-iam-policy-binding "$GCP_PROJECT_ID" \
172
+ --member "serviceAccount:stackdriver-exporter@$GCP_PROJECT_ID.iam.gserviceaccount.com" \
173
+ --role "roles/monitoring.viewer"
174
+
175
+ gcloud iam service-accounts add-iam-policy-binding \
176
+ --role roles/iam.workloadIdentityUser \
177
+ --member "serviceAccount:$GCP_PROJECT_ID.svc.id.goog[monitoring/stackdriver-exporter]" \
178
+ "stackdriver-exporter@$GCP_PROJECT_ID.iam.gserviceaccount.com"
179
+
180
+ # Annotate Kubernetes SA
181
+ kubectl annotate serviceaccount stackdriver-exporter \
182
+ "iam.gke.io/gcp-service-account=stackdriver-exporter@$GCP_PROJECT_ID.iam.gserviceaccount.com" \
183
+ --namespace monitoring
184
+ fi
185
+
152
186
  helm upgrade --install stackdriver-exporter \
153
187
  stable/stackdriver-exporter \
154
188
  --namespace monitoring \
155
189
  -f stackdriver-exporter/values.yaml \
156
- --version 1.2.3
190
+ --version 1.3.0
157
191
  fi
158
192
 
159
193
  ## Install Prometheus