-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildspec.yml
More file actions
63 lines (52 loc) · 1.33 KB
/
buildspec.yml
File metadata and controls
63 lines (52 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
version: 0.2
env:
shell: bash
phases:
install:
runtime-versions:
nodejs: latest
ruby: 2.6
commands:
- pip3 install --upgrade cfn-lint
# Install cfn_nag
- gem install cfn-nag
- node -v
- npm -v
- npm i -g npm
pre_build:
commands:
- echo "pre_build steps for revision ${CODEBUILD_RESOLVED_SOURCE_VERSION}..."
- pwd
- echo $CODEBUILD_WEBHOOK_HEAD_REF
- echo $CODEBUILD_WEBHOOK_TRIGGER
- echo $CODEBUILD_WEBHOOK_BASE_REF
- echo $CODEBUILD_SRC_DIR
- env
- node -v
- aws --version
- cfn-lint -v
- cfn_nag -v
# Lint
- cfn-lint # uses .cfnlintrc
# Run cfn-nag (looks for patterns in CFN templates that may indicate insecure infrastructure)
- cfn_nag_scan --output-format txt --print-suppression --fail-on-warnings --blacklist-path .cfn_nag_blacklist --input-path . --template-pattern '^(?!.*buildspec.*)((..*\.y[a]?ml)|(..*\.template))$'
- npm install
build:
commands:
- echo Build started on `date`
- echo Building Node app...
- npm run build
- npm run test:cypress
post_build:
commands:
- echo Build completed on `date`
- echo Files
- ls -la
artifacts:
files:
- '**/*'
base-directory: build
cache:
paths:
- '/node_modules/**/*'