-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildspec.yml
21 lines (19 loc) · 878 Bytes
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
version: 0.2
phases:
build:
commands:
- CurrentVersion=$(echo $(aws lambda get-alias --function-name $LAMBDA_FUNCTION_NAME --name $LAMBDA_FUNCTION_AlIAS | grep FunctionVersion | tail -1 |tr -cd "[0-9]"))
post_build:
commands:
- ls
- aws lambda publish-version --function-name $LAMBDA_FUNCTION_NAME
- TargetVersion=$(echo $(aws lambda list-versions-by-function --function-name $LAMBDA_FUNCTION_NAME | grep Version | tail -1 | tr -cd "[0-9]"))
- echo $CurrentVersion
- echo $TargetVersion
- sed -i -e "s/{{CurrentVersion}}/$CurrentVersion/g" appspec.yml
- sed -i -e "s/{{TargetVersion}}/$TargetVersion/g" appspec.yml
- sed -i -e "s/{{LAMBDA_FUNCTION_NAME}}/$LAMBDA_FUNCTION_NAME/g" appspec.yml
- sed -i -e "s/{{LAMBDA_FUNCTION_AlIAS}}/$LAMBDA_FUNCTION_AlIAS/g" appspec.yml
artifacts:
files:
- "**/*"