@leverege/build-tools 2.5.40 → 2.5.42

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.
File without changes
Binary file
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.5.40",
3
+ "version": "2.5.42",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -53,32 +53,33 @@
53
53
  "chalk": "^4.1.1",
54
54
  "clear": "^0.1.0",
55
55
  "clipboardy": "^2.3.0",
56
- "command-line-args": "^5.1.1",
56
+ "command-line-args": "^5.1.3",
57
57
  "command-line-usage": "^6.1.1",
58
- "dotenv": "^9.0.2",
59
- "execa": "^5.0.0",
58
+ "deepmerge": "^4.2.2",
59
+ "dotenv": "^10.0.0",
60
+ "execa": "^5.1.1",
60
61
  "figlet": "^1.5.0",
61
62
  "git-branch": "^2.0.1",
62
63
  "glob": "^7.1.7",
63
- "inquirer": "^7.3.3",
64
+ "inquirer": "^8.1.2",
64
65
  "js-yaml": "^4.1.0",
65
66
  "kubernetes-client": "^9.0.0",
66
67
  "ncp": "^2.0.0",
67
- "npm-check-updates": "^11.5.12",
68
- "npm-registry-fetch": "^9.0.0",
69
- "open": "^8.0.8",
70
- "ora": "^5.4.0",
68
+ "npm-check-updates": "^11.8.3",
69
+ "npm-registry-fetch": "^11.0.0",
70
+ "open": "^8.2.1",
71
+ "ora": "^5.4.1",
71
72
  "parse-gitignore": "^1.0.1",
72
73
  "readline-sync": "^1.4.10",
73
74
  "semver": "^7.3.5",
74
- "simple-git": "^2.39.0"
75
+ "simple-git": "^2.41.1"
75
76
  },
76
77
  "devDependencies": {
77
- "@babel/cli": "^7.13.16",
78
- "@babel/core": "^7.14.2",
79
- "@babel/node": "^7.14.2",
80
- "@leverege/babel-preset-leverege-node": "^1.1.1",
81
- "@leverege/eslint-config-leverege": "^2.2.0",
82
- "npm": "^7.13.0"
78
+ "@babel/cli": "^7.14.5",
79
+ "@babel/core": "^7.14.6",
80
+ "@babel/node": "^7.14.7",
81
+ "@leverege/babel-preset-leverege-node": "^1.2.0",
82
+ "@leverege/eslint-config-leverege": "^3.0.0",
83
+ "npm": "^7.19.1"
83
84
  }
84
85
  }
package/src/bash-funcs CHANGED
@@ -70,3 +70,16 @@ function setOrUnset() {
70
70
  [ ! -z "$1" ] && setting=`color g $1`
71
71
  echo "$setting"
72
72
  }
73
+
74
+ function getManagedSecret() {
75
+ local SECNAME=$1
76
+ local PROJECT="${2:-leverege-docker-images}"
77
+ SECRET=$(gcloud secrets versions access latest --secret="$SECNAME" --project=$PROJECT)
78
+ if [ $? -ne 0 ];
79
+ then
80
+ printf "This failed=>[gcloud secrets versions access latest --secret="$SECNAME" --project=$PROJECT]\n"
81
+ printf "Returned =>[$SECRET]\n\n"
82
+ exit 1
83
+ fi
84
+ echo $SECRET
85
+ }
package/src/circleate CHANGED
@@ -99,7 +99,7 @@ jobs:
99
99
 
100
100
  install:
101
101
  docker:
102
- - image: circleci/node:erbium
102
+ - image: circleci/node:fermium
103
103
  steps:
104
104
  - checkout
105
105
  - restore_cache:
@@ -125,7 +125,7 @@ jobs:
125
125
 
126
126
  security-check:
127
127
  docker:
128
- - image: circleci/node:erbium
128
+ - image: circleci/node:fermium
129
129
  steps:
130
130
  - checkout
131
131
  - attach_workspace:
@@ -136,7 +136,7 @@ jobs:
136
136
 
137
137
  license-check:
138
138
  docker:
139
- - image: circleci/node:erbium
139
+ - image: circleci/node:fermium
140
140
  steps:
141
141
  - checkout
142
142
  - attach_workspace:
@@ -151,7 +151,7 @@ jobs:
151
151
 
152
152
  lint:
153
153
  docker:
154
- - image: circleci/node:erbium
154
+ - image: circleci/node:fermium
155
155
  steps:
156
156
  - checkout
157
157
  - attach_workspace:
@@ -165,7 +165,7 @@ jobs:
165
165
 
166
166
  docs:
167
167
  docker:
168
- - image: circleci/node:erbium
168
+ - image: circleci/node:fermium
169
169
  steps:
170
170
  - checkout
171
171
  - attach_workspace:
@@ -182,7 +182,7 @@ jobs:
182
182
  environment:
183
183
  TZ: 'America/New_York'
184
184
  docker:
185
- - image: circleci/node:erbium
185
+ - image: circleci/node:fermium
186
186
  # IF YOU NEED ANY OF THESE, UNCOMMENT TO USE
187
187
  # - image: redis
188
188
  # - image: circleci/mysql:5.7
@@ -227,7 +227,7 @@ jobs:
227
227
  build:
228
228
  # build should make dist image and prepare docker file
229
229
  docker:
230
- - image: circleci/node:erbium
230
+ - image: circleci/node:fermium
231
231
 
232
232
  steps:
233
233
  - checkout
@@ -325,7 +325,7 @@ version: 2.1
325
325
  jobs:
326
326
  install:
327
327
  docker:
328
- - image: circleci/node:erbium
328
+ - image: circleci/node:fermium
329
329
  steps:
330
330
  - checkout
331
331
  - restore_cache:
@@ -351,7 +351,7 @@ jobs:
351
351
 
352
352
  security-check:
353
353
  docker:
354
- - image: circleci/node:erbium
354
+ - image: circleci/node:fermium
355
355
  steps:
356
356
  - checkout
357
357
  - attach_workspace:
@@ -362,7 +362,7 @@ jobs:
362
362
 
363
363
  license-check:
364
364
  docker:
365
- - image: circleci/node:erbium
365
+ - image: circleci/node:fermium
366
366
  steps:
367
367
  - checkout
368
368
  - attach_workspace:
@@ -377,7 +377,7 @@ jobs:
377
377
 
378
378
  lint:
379
379
  docker:
380
- - image: circleci/node:erbium
380
+ - image: circleci/node:fermium
381
381
  steps:
382
382
  - checkout
383
383
  - attach_workspace:
@@ -391,7 +391,7 @@ jobs:
391
391
 
392
392
  docs:
393
393
  docker:
394
- - image: circleci/node:erbium
394
+ - image: circleci/node:fermium
395
395
  steps:
396
396
  - checkout
397
397
  - attach_workspace:
@@ -408,7 +408,7 @@ jobs:
408
408
  environment:
409
409
  TZ: 'America/New_York'
410
410
  docker:
411
- - image: circleci/node:erbium
411
+ - image: circleci/node:fermium
412
412
  # IF YOU NEED ANY OF THESE, UNCOMMENT TO USE
413
413
  # - image: redis
414
414
  # - image: circleci/mysql:5.7
@@ -538,7 +538,7 @@ jobs:
538
538
 
539
539
  build:
540
540
  docker:
541
- - image: circleci/node:erbium
541
+ - image: circleci/node:fermium
542
542
  steps:
543
543
  - checkout
544
544
  - restore_cache:
@@ -572,7 +572,7 @@ jobs:
572
572
 
573
573
  deploy-dev:
574
574
  docker:
575
- - image: circleci/node:erbium
575
+ - image: circleci/node:fermium
576
576
  steps:
577
577
  - attach_workspace:
578
578
  at: ~/project
@@ -583,7 +583,7 @@ jobs:
583
583
 
584
584
  deploy-prod:
585
585
  docker:
586
- - image: circleci/node:erbium
586
+ - image: circleci/node:fermium
587
587
  steps:
588
588
  - attach_workspace:
589
589
  at: ~/project
package/src/dockreate CHANGED
@@ -4,6 +4,8 @@ if [ -z "$1" ]; then
4
4
  exit 1
5
5
  fi
6
6
 
7
+ printf "----HERE----\n" # XXX
8
+
7
9
  # Global Vars
8
10
  pluginFile="Dockerfile.plugin"
9
11
 
@@ -122,8 +124,6 @@ alias h=history
122
124
  alias ls='ls -CF --color=auto'
123
125
  alias ll='ls -lh'
124
126
  alias lla='ls -lha'
125
- alias ltr='ls -CF --color=auto -lthr'
126
- alias genv='env | grep -i'
127
127
  alias glep='grep -l -s'
128
128
  alias m=less
129
129
  alias menv='env | sort | less'
@@ -149,20 +149,6 @@ cmclear()
149
149
  {
150
150
  cmstat /status/clear
151
151
  }
152
-
153
- loglev()
154
- {
155
- local wget='wget -q -O- localhost:5111'
156
- local logl=''
157
-
158
- if [ "\$1" != "" ];
159
- then
160
- logl="logLevel/\$1"
161
- fi
162
-
163
- printf "Running=> \$wget/\${logl}\n"
164
- printf "\n\`\$wget/\$logl\`\n\n"
165
- }
166
152
  EOBASHRC
167
153
  } # end of create_bashrc
168
154
 
@@ -205,7 +191,7 @@ NOPROJ
205
191
  fi
206
192
 
207
193
  nodeimg=$(strip_undefined "`node -p \"require('../package.json').leverege.nodeimg\"`")
208
- nodeimg="${nodeimg:-erbium-alpine}"
194
+ nodeimg="${nodeimg:-fermium-alpine}"
209
195
  apkadds=$(strip_undefined "`node -p \"require('../package.json').leverege.apkadds\"`")
210
196
  runuser=$(strip_undefined "`node -p \"require('../package.json').leverege.runuser\"`")
211
197
  [ -z "${runuser}" ] && runuser='node'
package/src/helminit-dp CHANGED
File without changes
File without changes
package/src/helminit-svc CHANGED
File without changes
package/src/iam-roles ADDED
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env node
2
+
3
+ const chalk = require( 'chalk' )
4
+ const execa = require( 'execa' )
5
+
6
+ const condir = ( log, thing, depth = 8 ) => {
7
+ console.dir( { log, thing }, { depth, colors : true } ) // eslint-disable-line
8
+ }
9
+
10
+ const PLATFORM=[
11
+ "authz-server",
12
+ "api-server",
13
+ "db-curator",
14
+ "emailer",
15
+ "geotile-server",
16
+ "imagine",
17
+ "message-processor",
18
+ "messenger",
19
+ "reason",
20
+ "resource-server",
21
+ "scheduler",
22
+ "transponder-bq",
23
+ "transponder-rt",
24
+ "transponder-postgres",
25
+ ]
26
+
27
+ // gcloud projects get-iam-policy ${PROJECT} \
28
+ // --flatten="bindings[].members" \
29
+ // --filter="bindings.members:${SVCACCT}@prd-recovr-auto.iam.gserviceaccount.com" \
30
+ // --format="table(bindings.role)"
31
+
32
+ const gcloudProject = 'prd-recovr-auto'
33
+ const gcloudFetchIam = [ 'projects', 'get-iam-policy', gcloudProject, '--format=json' ]
34
+
35
+ const runner = async ( x, y ) => {
36
+ const patternSvcAcct = new RegExp( /(?<type>serviceAccount):(?<sa>\S+)@(?<project>\S+).iam.gserviceaccount.com/ )
37
+ const patternUser = new RegExp( /(?<type>user):(?<email>\S+)/ )
38
+ try {
39
+ const { stdout } = await execa( 'gcloud', gcloudFetchIam )
40
+ const bindings = JSON.parse( stdout ).bindings
41
+ // condir( 'All Bindings', bindings )// XXX
42
+ const iamRoles = {}
43
+ bindings.forEach( binding => {
44
+ const role = binding.role.replace( 'roles/', '' )
45
+ for( let i = 0; i < binding.members.length; i++ ) {
46
+ const member = binding.members[i]
47
+ const svcacct = member.match( patternSvcAcct )
48
+ if ( svcacct?.groups ) {
49
+ const { type, sa } = svcacct.groups
50
+ iamRoles[ sa ] = iamRoles[ sa ] || []
51
+ iamRoles[ sa ].push( role )
52
+ continue
53
+ }
54
+ const user = member.match( patternUser )
55
+ if ( user?.groups ) {
56
+ const { type, email } = user.groups
57
+ iamRoles[ email ] = iamRoles[ email ] || []
58
+ iamRoles[ email ].push( role )
59
+ continue
60
+ }
61
+ console.log( `Dont Care? [${member}]` )
62
+ }
63
+ } )
64
+ console.log( iamRoles )
65
+ } catch ( err ) {
66
+ console.log( err, 'what went wrong?' )
67
+ }
68
+ }
69
+
70
+ runner()
package/CHANGELOG.md DELETED
@@ -1,46 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- ## [2.3.1] = 2020-05-10
5
- ### Updated
6
- - (Circleate) Updated support for UI circle config
7
-
8
- ## [2.2.3] = 2020-04-22
9
- ### Updated
10
- - (Helmify) Added a CLI interface for Helmup
11
-
12
- ## [2.1.5] - 2020-03-08
13
- ### Updated
14
- - (Helmup) Simplified Timescale installation process
15
-
16
- ## [2.0.0] - 2020-02-12
17
- ### Added
18
- - (encrypt/decrypt) Allow for external KMS (BREAKING!!!)
19
-
20
- ## [1.6.3] - 2019-07-02
21
- ### Added
22
- - (pkglint) Added pkglint check for valid files
23
-
24
- ## [1.5.0] - 2019-06-07
25
- ### Added
26
- - (Dnsify) Added new Dnsify script to add new DNS records to cloudflare
27
-
28
- ## [1.4.0] - 2019-05-02
29
- ### Added
30
- - (Helmify) Added new Helmify script to bootstrap helm templates
31
-
32
- ## [0.7.1] - 2019-03-07
33
- ### Updated
34
- - (Overwhelm) Replaced glob library to fix vulnerability issue
35
-
36
- ## [0.5.0] - 2019-03-04
37
- ### Replaced
38
- - (Encrypt/Decrypt) Deprecate OpenSSL for GCP KMS encryption method
39
-
40
- ## [0.4.0] - 2019-02-21
41
- ### Added
42
- - (Circleate) Added smoke test step to do security audit
43
- - (Circleate) Account for edge cases with non-standard container name
44
-
45
- ### Removed
46
- - (Circleate) Deleted junit reporter for test coverage