@leverege/build-tools 2.2.4 → 2.2.6

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.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/circleate CHANGED
@@ -90,17 +90,18 @@ jobs:
90
90
  source-tag: \$PACKAGE_VERSION
91
91
  target-tag: circle-\$NODE_IMAGE-\$CIRCLE_USERNAME
92
92
 
93
- smoke-test:
94
- # smoke test checks for license, security, and linting
95
- docker:
93
+ install:
94
+ docker:
96
95
  - image: circleci/node:erbium
97
96
  steps:
98
97
  - checkout
99
98
  - restore_cache:
100
99
  key: dependency-cache-{{ checksum "package.json" }}
100
+
101
101
  - run:
102
102
  name: Setup @leverege Token
103
- command: echo \${NPMRC} > ~/.npmrc
103
+ command: echo \${NPMRC} > ~/.npmrc.ro
104
+
104
105
  - run: npm install
105
106
 
106
107
  - save_cache:
@@ -108,20 +109,44 @@ jobs:
108
109
  paths:
109
110
  - ./node_modules
110
111
 
112
+ - persist_to_workspace:
113
+ root: /home/circleci/project
114
+ paths:
115
+ - ./node_modules
116
+
117
+ security-check:
118
+ docker:
119
+ - image: circleci/node:erbium
120
+ steps:
121
+ - checkout
122
+ - attach_workspace:
123
+ at: ~/project
111
124
  - run:
112
125
  name: Check for vulnerabilities
113
126
  command: npm audit --production --audit-level=moderate
114
-
127
+
128
+ license-check:
129
+ docker:
130
+ - image: circleci/node:erbium
131
+ steps:
132
+ - checkout
133
+ - attach_workspace:
134
+ at: ~/project
115
135
  - run:
116
136
  name: Check for LICENSE and README files
117
137
  command: npm run pkglint
118
138
 
119
139
  - run:
120
140
  name: Check for license violations (e.g. GPL)
121
- command: |
122
- npm install license-checker
123
- npm run licenseCheck
141
+ command: npx license-checker --production --summary --failOn GPL
124
142
 
143
+ lint:
144
+ docker:
145
+ - image: circleci/node:erbium
146
+ steps:
147
+ - checkout
148
+ - attach_workspace:
149
+ at: ~/project
125
150
  - run:
126
151
  name: Lint and save results
127
152
  command: npm run lint-ci
@@ -129,6 +154,20 @@ jobs:
129
154
  - store_test_results:
130
155
  path: reports
131
156
 
157
+ docs:
158
+ docker:
159
+ - image: circleci/node:erbium
160
+ steps:
161
+ - checkout
162
+ - attach_workspace:
163
+ at: ~/project
164
+ - run:
165
+ name: Generate docs
166
+ command: npx jsdoc -r src -R README.md -d docs
167
+ - store_artifacts:
168
+ path: docs
169
+ prefix: docs
170
+
132
171
  coverage:
133
172
  # coverage runs tests, generates coverage, and saves docs
134
173
  environment:
@@ -156,14 +195,8 @@ jobs:
156
195
 
157
196
  steps:
158
197
  - checkout
159
- - restore_cache:
160
- key: dependency-cache-{{ checksum "package.json" }}
161
-
162
- - run:
163
- name: Setup @leverege Token
164
- command: echo \${NPMRC} > ~/.npmrc
165
-
166
- - run: npm install
198
+ - attach_workspace:
199
+ at: ~/project
167
200
 
168
201
  # UNCOMMENT IF YOU NEED DECRYPTING SECRETS
169
202
  # - run:
@@ -177,21 +210,11 @@ jobs:
177
210
  - run:
178
211
  name: Check if coverage meets at least 70%
179
212
  command: ./node_modules/.bin/nyc check-coverage --functions 70 --lines 70 --statements 70
180
-
181
- - run:
182
- name: Generate docs
183
- command: |
184
- npm install jsdoc
185
- npm run docs
186
-
213
+
187
214
  - store_artifacts:
188
215
  path: coverage
189
216
  prefix: coverage
190
-
191
- - store_artifacts:
192
- path: docs
193
- prefix: docs
194
-
217
+
195
218
  build:
196
219
  # build should make dist image and prepare docker file
197
220
  docker:
@@ -199,16 +222,12 @@ jobs:
199
222
 
200
223
  steps:
201
224
  - checkout
202
- - restore_cache:
203
- key: dependency-cache-{{ checksum "package.json" }}
225
+ - attach_workspace:
226
+ at: ~/project
204
227
 
205
228
  - run:
206
229
  name: Setup @leverege Token
207
- command: |
208
- echo \${NPMRC} > ~/.npmrc
209
- echo \${NPMRC} > ~/.npmrc.ro
210
-
211
- - run: npm install
230
+ command: echo \${NPMRC} > ~/.npmrc.ro
212
231
 
213
232
  - run:
214
233
  name: Determine version number and container name
@@ -225,6 +244,7 @@ jobs:
225
244
  echo "export PACKAGE_VERSION=v\${PACKAGE_VERSION}" >> \$BASH_ENV
226
245
  echo \${container} > container_name
227
246
  echo \${NODE_IMAGE} > node_img
247
+
228
248
  - run:
229
249
  name: Create Dockerfile and build dist directory
230
250
  command: mkdir -p docker && npm run dockerize \$PACKAGE_VERSION
@@ -232,23 +252,32 @@ jobs:
232
252
  - persist_to_workspace:
233
253
  root: ~/project
234
254
  paths:
235
- - dist/*
236
255
  - docker/*
237
256
  - package_version
238
257
  - container_name
239
258
  - node_img
240
- - package*json
241
259
 
242
260
  workflows:
243
261
  version: 2.1
244
262
  test-build-deploy:
245
263
  jobs:
246
- - smoke-test:
264
+ - install:
247
265
  context: npm
266
+ - security-check:
267
+ requires:
268
+ - install
269
+ - license-check:
270
+ requires:
271
+ - install
272
+ - lint:
273
+ requires:
274
+ - install
248
275
  - coverage:
249
- context: npm
250
276
  requires:
251
- - smoke-test
277
+ - install
278
+ - docs:
279
+ requires:
280
+ - install
252
281
  - build:
253
282
  context: npm
254
283
  filters:
@@ -258,7 +287,12 @@ workflows:
258
287
  - /release-.*/
259
288
  - master
260
289
  requires:
261
- - smoke-test
290
+ - install
291
+ - security-check
292
+ - license-check
293
+ - lint
294
+ - coverage
295
+ - docs
262
296
  - gcr:
263
297
  context: google
264
298
  filters:
@@ -268,9 +302,13 @@ workflows:
268
302
  - /release-.*/
269
303
  - master
270
304
  requires:
271
- - smoke-test
272
- - build
305
+ - install
306
+ - security-check
307
+ - license-check
308
+ - lint
273
309
  - coverage
310
+ - docs
311
+ - build
274
312
  EOCIRCLE
275
313
  }
276
314
 
@@ -278,17 +316,18 @@ create_lib_config(){
278
316
  cat<<EOCIRCLE > config.yml
279
317
  version: 2.1
280
318
  jobs:
281
- smoke-test:
282
- # smoke test checks for license, security, and linting
283
- docker:
319
+ install:
320
+ docker:
284
321
  - image: circleci/node:erbium
285
322
  steps:
286
323
  - checkout
287
324
  - restore_cache:
288
325
  key: dependency-cache-{{ checksum "package.json" }}
326
+
289
327
  - run:
290
328
  name: Setup @leverege Token
291
- command: echo \${NPMRC} > ~/.npmrc
329
+ command: echo \${NPMRC} > ~/.npmrc.ro
330
+
292
331
  - run: npm install
293
332
 
294
333
  - save_cache:
@@ -296,20 +335,44 @@ jobs:
296
335
  paths:
297
336
  - ./node_modules
298
337
 
338
+ - persist_to_workspace:
339
+ root: /home/circleci/project
340
+ paths:
341
+ - ./node_modules
342
+
343
+ security-check:
344
+ docker:
345
+ - image: circleci/node:erbium
346
+ steps:
347
+ - checkout
348
+ - attach_workspace:
349
+ at: ~/project
299
350
  - run:
300
351
  name: Check for vulnerabilities
301
352
  command: npm audit --production --audit-level=moderate
302
-
353
+
354
+ license-check:
355
+ docker:
356
+ - image: circleci/node:erbium
357
+ steps:
358
+ - checkout
359
+ - attach_workspace:
360
+ at: ~/project
303
361
  - run:
304
362
  name: Check for LICENSE and README files
305
363
  command: npm run pkglint
306
364
 
307
365
  - run:
308
366
  name: Check for license violations (e.g. GPL)
309
- command: |
310
- npm install license-checker
311
- npm run licenseCheck
367
+ command: npx license-checker --production --summary --failOn GPL
312
368
 
369
+ lint:
370
+ docker:
371
+ - image: circleci/node:erbium
372
+ steps:
373
+ - checkout
374
+ - attach_workspace:
375
+ at: ~/project
313
376
  - run:
314
377
  name: Lint and save results
315
378
  command: npm run lint-ci
@@ -317,8 +380,24 @@ jobs:
317
380
  - store_test_results:
318
381
  path: reports
319
382
 
383
+ docs:
384
+ docker:
385
+ - image: circleci/node:erbium
386
+ steps:
387
+ - checkout
388
+ - attach_workspace:
389
+ at: ~/project
390
+ - run:
391
+ name: Generate docs
392
+ command: npx jsdoc -r src -R README.md -d docs
393
+ - store_artifacts:
394
+ path: docs
395
+ prefix: docs
396
+
320
397
  coverage:
321
398
  # coverage runs tests, generates coverage, and saves docs
399
+ environment:
400
+ TZ: 'America/New_York'
322
401
  docker:
323
402
  - image: circleci/node:erbium
324
403
  # IF YOU NEED ANY OF THESE, UNCOMMENT TO USE
@@ -342,20 +421,14 @@ jobs:
342
421
 
343
422
  steps:
344
423
  - checkout
345
- - restore_cache:
346
- key: dependency-cache-{{ checksum "package.json" }}
347
-
348
- - run:
349
- name: Setup @leverege Token
350
- command: echo \${NPMRC} > ~/.npmrc
351
-
352
- - run: npm install
424
+ - attach_workspace:
425
+ at: ~/project
353
426
 
354
427
  # UNCOMMENT IF YOU NEED DECRYPTING SECRETS
355
428
  # - run:
356
429
  # name: Load secrets
357
430
  # command: npm run decrypt
358
-
431
+
359
432
  - run:
360
433
  name: Run Tests and Generate Code Coverage
361
434
  command: npm run coverage
@@ -363,42 +436,32 @@ jobs:
363
436
  - run:
364
437
  name: Check if coverage meets at least 70%
365
438
  command: ./node_modules/.bin/nyc check-coverage --functions 70 --lines 70 --statements 70
366
-
367
- - run:
368
- name: Generate docs
369
- command: |
370
- npm install jsdoc
371
- npm run docs
372
-
439
+
373
440
  - store_artifacts:
374
441
  path: coverage
375
442
  prefix: coverage
376
443
 
377
- - store_artifacts:
378
- path: docs
379
- prefix: docs
380
-
381
- # publish:
382
- # # publish the package to npm registry - CURRENTLY DISABLED
383
-
384
444
  workflows:
385
445
  version: 2.1
386
446
  test-build-deploy:
387
447
  jobs:
388
- - smoke-test:
448
+ - install:
389
449
  context: npm
450
+ - security-check:
451
+ requires:
452
+ - install
453
+ - license-check:
454
+ requires:
455
+ - install
456
+ - lint:
457
+ requires:
458
+ - install
390
459
  - coverage:
391
- context: npm
392
460
  requires:
393
- - smoke-test
394
- # - publish:
395
- # context: npm
396
- # filters:
397
- # branches:
398
- # only: master
399
- # requires:
400
- # - smoke-test
401
- # - coverage
461
+ - install
462
+ - docs:
463
+ requires:
464
+ - install
402
465
  EOCIRCLE
403
466
  }
404
467
 
@@ -69,7 +69,7 @@ fi
69
69
  git_origin=`git config --get remote.origin.url`
70
70
 
71
71
  if [[ $git_origin = https* ]]; then
72
- git_orgname=`echo $git_origin | cut -d "@" -f 2 | cut -d "/" -f 2`
72
+ git_orgname=`echo $git_origin | cut -d "/" -f 4`
73
73
  else
74
74
  git_orgname=`echo $git_origin | cut -d ":" -f 2 | cut -d "/" -f 1`
75
75
  fi
@@ -13,7 +13,7 @@ fi
13
13
  git_origin=`git config --get remote.origin.url`
14
14
 
15
15
  if [[ $git_origin = https* ]]; then
16
- git_orgname=`echo $git_origin | cut -d "@" -f 2 | cut -d "/" -f 2`
16
+ git_orgname=`echo $git_origin | cut -d "/" -f 4`
17
17
  else
18
18
  git_orgname=`echo $git_origin | cut -d ":" -f 2 | cut -d "/" -f 1`
19
19
  fi