@leverege/build-tools 2.113.4 → 2.113.5-pedro.1

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.113.4",
3
+ "version": "2.113.5-pedro.1",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
package/src/bash-funcs CHANGED
@@ -120,6 +120,18 @@ function getManagedSecret() {
120
120
  echo "$SECRET"
121
121
  }
122
122
 
123
+ # Fail fast when gcloud cannot mint tokens. Downstream tools capture gcloud
124
+ # output, so reauthentication cannot prompt there; surfacing it here lets
125
+ # gcloud reauth interactively on the TTY when policy allows. stdout goes to a
126
+ # literal /dev/null (NOT $DEVNULL, which is /dev/stderr in debug mode) so the
127
+ # access tokens are never printed.
128
+ function errorIfStaleGcloudAuth() {
129
+ gcloud auth print-access-token > /dev/null
130
+ exitOnError $? "GCP credentials expired. Please run: `color g 'gcloud auth login'`"
131
+ gcloud auth application-default print-access-token > /dev/null
132
+ exitOnError $? "GCP application-default credentials expired. Please run: `color g 'gcloud auth application-default login'`"
133
+ }
134
+
123
135
  function getProjectIdFromK8sContext() {
124
136
  local currContext=`kubectl config current-context`
125
137
 
package/src/helmup.sh CHANGED
@@ -85,6 +85,9 @@ BAD_IDEA
85
85
  exit 1
86
86
  fi
87
87
 
88
+ # stop here rather than half way through a deploy if the creds cannot mint tokens
89
+ errorIfStaleGcloudAuth
90
+
88
91
  # artifact-registry => https://console.cloud.google.com/artifacts?project=leverege-registry
89
92
  REGISTRY_DOMAIN="us-docker.pkg.dev"
90
93
  # open container initiative (oci) => https://opencontainers.org/
@@ -95,6 +98,7 @@ gcloud auth application-default print-access-token | helm registry login \
95
98
 
96
99
  # make sure we have a current npmrc file
97
100
  refresh-npm-token
101
+ exitOnError $? "refresh-npm-token failed - the rc files were not refreshed"
98
102
 
99
103
  # removed geotile-server from standard platform 3/20/22 - low usage
100
104
  PLATFORM=(