-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yaml
36 lines (36 loc) · 2.12 KB
/
buildspec.yaml
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
version: 0.2
phases:
install:
runtime-versions:
python: 3.7
commands:
- pip install --upgrade pip
- pip install --upgrade awscli
- pip install cfn-lint
- apt-get update
- apt-get -y install ruby-full
- apt-get -y install jq
- gem install cfn-nag
pre_build:
commands:
- echo "Template Bucket Package Location is $TEMPLATE_BUCKET"
- mkdir ${CODEBUILD_SRC_DIR}/package
- cfn-lint -t templates/**/*.yml
- find ${CODEBUILD_SRC_DIR}/templates -name '*.yml' -print0 -or -name '*.yaml' -print0 | xargs -0 -I {file} sh -c 'echo Validating {file}; aws cloudformation validate-template --template-body file://{file}'
- cfn_nag_scan --input-path ${CODEBUILD_SRC_DIR}/templates/
build:
commands:
- aws cloudformation package --template-file ${CODEBUILD_SRC_DIR}/templates/ops/ue4/main.yml --output-template-file ${CODEBUILD_SRC_DIR}/package/ue4-main.yml --s3-bucket ${TEMPLATE_BUCKET} --s3-prefix ue4-package
- aws cloudformation package --template-file ${CODEBUILD_SRC_DIR}/templates/bootstrap/bootstrap-aws-batch-custom-action.yml --output-template-file ${CODEBUILD_SRC_DIR}/package/bootstrap-aws-batch-custom-action.yml --s3-bucket ${TEMPLATE_BUCKET} --s3-prefix bs-package
- aws cloudformation package --template-file ${CODEBUILD_SRC_DIR}/templates/bootstrap/bootstrap-aws-batch-job-itch.yml --output-template-file ${CODEBUILD_SRC_DIR}/package/bootstrap-aws-batch-job-itch.yml --s3-bucket ${TEMPLATE_BUCKET} --s3-prefix bs-package
- aws cloudformation package --template-file ${CODEBUILD_SRC_DIR}/templates/bootstrap/main.yml --output-template-file ${CODEBUILD_SRC_DIR}/package/bootstrap-main.yml --s3-bucket ${TEMPLATE_BUCKET} --s3-prefix bs-package
post_build:
commands:
- find ${CODEBUILD_SRC_DIR}/package -name '*.yml' -print0 -or -name '*.yaml' -print0 | xargs -0 -I {file} sh -c 'echo Validating {file}; aws cloudformation validate-template --template-body file://{file}'
- cfn_nag_scan --input-path ${CODEBUILD_SRC_DIR}/package
artifacts:
name: TemplateOutput
files:
- '**/*'
discard-paths: yes
base-directory: 'package'