-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yml
30 lines (29 loc) · 1.16 KB
/
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
version: 0.2
phases:
install:
runtime-versions:
java: corretto11
commands:
# Upgrade AWS CLI to the latest version
- pip install --upgrade awscli
pre_build:
commands:
- echo Test started on `date`
- mvn clean compile test
build:
commands:
- echo Build started on `date`
- mvn package shade:shade
- mv target/HelloWorld-1.0.jar .
- unzip HelloWorld-1.0.jar
- rm -rf target tst src buildspec.yml pom.xml HelloWorld-1.0.jar
- aws cloudformation package --template template.yml --s3-bucket $S3_BUCKET --output-template template-export.yml
post_build:
commands:
# Do not remove this statement. This command is required for AWS CodeStar projects.
# Update the AWS Partition, AWS Region, account ID and project ID in the project ARN on template-configuration.json file so AWS CloudFormation can tag project resources.
- sed -i.bak 's/\$PARTITION\$/'${PARTITION}'/g;s/\$AWS_REGION\$/'${AWS_REGION}'/g;s/\$ACCOUNT_ID\$/'${ACCOUNT_ID}'/g;s/\$PROJECT_ID\$/'${PROJECT_ID}'/g' template-configuration.json
artifacts:
files:
- template-export.yml
- template-configuration.json