-
Notifications
You must be signed in to change notification settings - Fork 2
/
buildspec.yml
35 lines (33 loc) · 1020 Bytes
/
buildspec.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
35
version: 0.2
env:
parameter-store:
NGINX_VER: /nrel/split/split_nginx_version_stable
exported-variables:
- NGINX_VER
- CODEBUILD_SOURCE_VERSION
- CODEBUILD_BUILD_ID
- CODEBUILD_SOURCE_VERSION_SHORT
phases:
install:
runtime-versions:
docker: 19
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com
- CODEBUILD_SOURCE_VERSION_SHORT=$(echo $CODEBUILD_SOURCE_VERSION | head -c 7)
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- make NGINX_VER="${NGINX_VER}" build
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker image...
- make push
- echo Writing image definitions file...
- printf '{"ImageURI":"%s"}' > imageDetail.json
artifacts:
files:
- imageDetail.json