-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildspec-sync.yml
34 lines (30 loc) · 1.75 KB
/
buildspec-sync.yml
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
---
version: 0.2
environment_variabls:
plaintext:
AWS_DEFAULT_REGION: "us-east-1"
phases:
install:
commands:
# Install the PyTest unit testing framework
- python3.6 -m pip install -U pytest
pre_build:
commands:
# Run the unit tests on the automation scripts before we use them
- pytest automation-scripts/
build:
commands:
# Step 1: Filter Git history to only the files we need to work with into different sets.
# Finally, run the AWS CloudFormation Validator against only the templates that are being changed. The validator
# is still run even on a build as any template that fails the validator wouldn't successfully launch here anyways
- python3.6 automation-scripts/automation-linter-files-filter.py templates $S3_BUCKET_NAME templates
# Step 2: Any linters or validators that you wish to run after the standard CloudFormation validator was run in
# Step 1 can be applied here. Please note that the template files that were modified as part of this PR are
# now in a directory called "templates-changed". You do not need to re-lint or re-validate the entire templates
# directory. Additionally, as this is the SYNC job and not the PR job, only run validators and linters here that
# you wish to fail the build all together if they don't pass.
# STEP 3: run the sync: The order of these operations is imporant. Templates MUST be synced before stacks.
# During each run, files are first deleted from s3 if they were removed, then new and updated files are uploaded
# to s3.
- python3.6 automation-scripts/automation-stack-sync.py templates $S3_BUCKET_NAME templates
- python3.6 automation-scripts/automation-stack-sync.py stacks $S3_BUCKET_NAME stacks