Skip to content

Commit bc5d5e7

Browse files
authoredJul 20, 2020
Added Snyk Step and converted to Generic Orb (ovotech#1)
* Added Snyk scan step * Remove references to migrations * Renamed orb and updated readme * Update CODEOWNERS
1 parent a89ad31 commit bc5d5e7

File tree

3 files changed

+14
-29
lines changed

3 files changed

+14
-29
lines changed
 

‎CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
/aws-get-parameters/ @ovotech/jaws
66
/tools-install/ @ovotech/orion-sre
77
/with-git-deploy-key/ @ovotech/orion-sre
8-
/migration-lambdas/ @ovotech/orion-migration
8+
/versioned-lambdas/ @ovotech/orion-migration

‎migration-lambdas/README.md ‎versioned-lambda/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Orion Migration AWS Lambda Build and Deploy CircleCI Orb
1+
# Orion Versioned AWS Lambda Build and Deploy CircleCI Orb
22

33
This orb can be used to build and deploy AWS lamba functions.
44

‎migration-lambdas/orb.yml ‎versioned-lambda/orb.yml

+12-27
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
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.
33

44
orbs:
55
aws-cli: circleci/aws-cli@1.2.0
6+
snyk: snyk/snyk@0.0.10
67

78
executors:
89
lambci-node12:
@@ -19,15 +20,11 @@ jobs:
1920
build-bucket:
2021
description: "AWS S3 bucket containing lambda build artifacts"
2122
type: string
22-
default: ovo-orion-migration-builds
23+
default: ovo-orion-versioned-build
2324
lambda-zipfile:
2425
description: "Name of the zip file containing the lambda application code. Defaults to lambda.zip"
2526
type: string
2627
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
3128
executor: << parameters.executor >>
3229
steps:
3330
- checkout
@@ -42,26 +39,14 @@ jobs:
4239
key: dependency-cache-{{ checksum "package-lock.json" }}
4340
paths:
4441
- ./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}
6550
- run:
6651
name: Lint
6752
command: npm run lint
@@ -87,7 +72,7 @@ jobs:
8772
build-bucket:
8873
description: "AWS S3 bucket containing lambda build artifacts"
8974
type: string
90-
default: ovo-orion-migration-builds
75+
default: ovo-orion-versioned-build
9176
lambda-zipfile:
9277
description: "Name of the zip file containing the lambda application code. Defaults to lambda.zip"
9378
type: string

0 commit comments

Comments
 (0)