-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yml
30 lines (28 loc) · 1.07 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:
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 mrt-admin-sinatra.zip vendor app *.rb
- aws s3 cp mrt-admin-sinatra.zip s3://${S3PRIVBUCKET}/deploy/
- |
aws lambda update-function-code \
--function-name mrt-admin-sinatra \
--s3-bucket ${S3PRIVBUCKET} \
--s3-key deploy/mrt-admin-sinatra.zip --no-cli-pager