1
1
version : 2.1
2
- description : An orb to build and deploy AWS Lambda functions written in node.js for Orion Migrations .
2
+ description : An orb to build and deploy AWS Lambda functions written in node.js for Orion Lambdas .
3
3
4
4
orbs :
5
5
aws-cli : circleci/aws-cli@1.2.0
6
+ snyk : snyk/snyk@0.0.10
6
7
7
8
executors :
8
9
lambci-node12 :
@@ -19,15 +20,11 @@ jobs:
19
20
build-bucket :
20
21
description : " AWS S3 bucket containing lambda build artifacts"
21
22
type : string
22
- default : ovo-orion-migration-builds
23
+ default : ovo-orion-versioned-build
23
24
lambda-zipfile :
24
25
description : " Name of the zip file containing the lambda application code. Defaults to lambda.zip"
25
26
type : string
26
27
default : lambda.zip
27
- vulnerability-audit :
28
- description : " Whether or not to run the npm audit step. Defaults to true"
29
- type : boolean
30
- default : true
31
28
executor : << parameters.executor >>
32
29
steps :
33
30
- checkout
@@ -42,26 +39,14 @@ jobs:
42
39
key : dependency-cache-{{ checksum "package-lock.json" }}
43
40
paths :
44
41
- ./node_modules
45
- - when :
46
- condition : << parameters.vulnerability-audit >>
47
- steps :
48
- - run :
49
- name : Vulnerability audit
50
- command : |
51
- set +e
52
- yum -y install jq
53
- npm audit --json > npm-audit.log
54
- cat npm-audit.log
55
-
56
- critical=$(jq '.metadata.vulnerabilities.critical' npm-audit.log)
57
- high=$(jq '.metadata.vulnerabilities.high' npm-audit.log)
58
- moderate=$(jq '.metadata.vulnerabilities.moderate' npm-audit.log)
59
-
60
- echo "Vulnerability scan results critical $critical high $high moderate $moderate"
61
- if [ "$high" -gt 0 ] || [ "$moderate" -gt 0 ] || [ "$critical" -gt 0 ]
62
- then
63
- exit 1
64
- fi
42
+ - run :
43
+ name : Sudo install
44
+ command : yum install -y sudo
45
+ - snyk/scan :
46
+ token-variable : SNYK_TOKEN
47
+ monitor-on-build : true
48
+ severity-threshold : medium
49
+ project : ${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}
65
50
- run :
66
51
name : Lint
67
52
command : npm run lint
87
72
build-bucket :
88
73
description : " AWS S3 bucket containing lambda build artifacts"
89
74
type : string
90
- default : ovo-orion-migration-builds
75
+ default : ovo-orion-versioned-build
91
76
lambda-zipfile :
92
77
description : " Name of the zip file containing the lambda application code. Defaults to lambda.zip"
93
78
type : string
0 commit comments