-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yml
35 lines (33 loc) · 1.26 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
31
32
33
34
35
version: 0.2
phases:
pre_build:
on-failure: ABORT
commands:
- COMMIT=`git rev-parse --short HEAD`
- TAG=`git describe --tags --exact-match 2> /dev/null || echo ''`
- |
if [[ "$MODE" == "OnPush" ]]
then
BRANCHTAG=`git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git name-rev $(git rev-parse --short HEAD) | cut -d' ' -f2 || git rev-parse --short HEAD`
else
BRANCHTAG=$BRANCHNAME
fi
- DOCKTAG=$BRANCHTAG
- COMMITDATE=`git --no-pager log -1 --pretty='format:%cd' --date='format:%Y-%m-%d %H:%M:%S'`
- echo "Branchtag ${BRANCHTAG}; COMMITDATE=${COMMITDATE}; REPONAME=${REPONAME}; BRANCHNAME=${BRANCHNAME}"
post_build:
on-failure: CONTINUE
commands:
- bundle install
- zip -r s3-sinatra-lb.zip vendor app *.rb
- aws s3 cp s3-sinatra-lb.zip s3://${S3PRIVBUCKET}/deploy/
- |
aws lambda update-function-code \
--function-name mrt-SinatraLambda-robbins \
--s3-bucket ${S3PRIVBUCKET} \
--s3-key deploy/s3-sinatra-lb.zip --no-cli-pager
- |
aws lambda update-function-code \
--function-name mrt-SinatraLambda-ucsfglantz \
--s3-bucket ${S3PRIVBUCKET} \
--s3-key deploy/s3-sinatra-lb.zip --no-cli-pager