-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yaml
57 lines (49 loc) · 1.96 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
version: 0.2
# Buildspec Reference Doc: https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-syntax
#################################
# Runtime Environment Variables #
#################################
# env:
# variables:
# key: "value"
# key: "value"
# parameter-store:
# key: "value"
# key: "value"
phases:
install:
commands:
# Use Install phase to install packages or any pre-reqs you may need throughout the build (e.g. dev deps, security checks, etc.)
# - echo "[Install phase]"
pre_build:
commands:
# Use Pre-Build phase to run tests, install any code deps or any other customization before build
# - echo "[Pre-Build phase]"
build:
commands:
# Use Build phase to build your artifacts (compile, package, etc.)
# - echo "[Build phase]"
# We package the SAM template and create `packaged.yaml` file that will be used in our pipeline for deployment
## Here we separate Build from Deployment and segregate permissions for different steps
- echo "Starting SAM packaging `date` in `pwd`"
- aws cloudformation package --template-file template.yaml --s3-bucket $BUILD_OUTPUT_BUCKET --output-template-file packaged.yaml
post_build:
commands:
# Use Post Build for notifications, git tags and any further customization after build
# - echo "[Post-Build phase]"
- echo "SAM packaging completed on `date`"
##################################
# Build Artifacts to be uploaded #
##################################
artifacts:
files:
# list of local files relative to this build environment that will be added to the final artifact (zip)
- packaged.yaml
discard-paths: yes
#########################################
# Cache local files for subsequent runs #
#########################################
cache:
paths:
# List of path that CodeBuild will upload to S3 Bucket and use in subsequent runs to speed up Builds
# - '/root/.cache/pip'