-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildspec.yml
More file actions
53 lines (43 loc) · 1.29 KB
/
buildspec.yml
File metadata and controls
53 lines (43 loc) · 1.29 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
version: 0.2
env:
shell: bash
phases:
install:
runtime-versions:
java: corretto17
commands:
- pip3 install --upgrade cfn-lint
# Upgrade AWS CLI to the latest version
# Install aws-sam-cli
- pip3 install aws-sam-cli -U
# Install cfn_nag
- gem install cfn-nag
pre_build:
commands:
- echo "pre_build steps for revision ${CODEBUILD_RESOLVED_SOURCE_VERSION}..."
- env
- node -v
- gradle --version
- aws --version
- cfn-lint -v
- cfn_nag -v
# Lint
- cfn-lint -i W # uses .cfnlintrc
# Run cfn-nag (looks for patterns in CFN templates that may indicate insecure infrastructure)
- cfn_nag_scan --output-format txt --print-suppression --blacklist-path .cfn_nag_blacklist --input-path . --template-pattern '^(?!.*buildspec\.y[a]?ml)((..*\.y[a]?ml)|(..*\.template))$'
build:
commands:
- echo Build started on `date`
# Use AWS SAM to build and package the application by using AWS CloudFormation
- sam build
- sam package --s3-bucket $S3_BUCKET --output-template-file packaged.yml
# Lint after 'package'
- cfn-lint packaged.yml
post_build:
commands:
- echo Build completed on `date`
- echo Files
- ls -l
artifacts:
files:
- '**/*'