-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildspec.yml
73 lines (67 loc) · 2.63 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
version: 0.2
# Pre-requisites
# - Create CodeBuild project
# - Provide minimal github credentials to access public repo
phases:
pre_build:
on-failure: ABORT
commands:
- COMMIT=`git rev-parse --short HEAD`
- # Get semantic tags for commit otherwise get all tags for commit, sort and choose the last value
- TAG=`(git tag --contains $COMMIT | egrep "^[0-9]+\.[0-9]+\.[0-9]+$" || git tag --contains $COMMIT || echo '') | sort | tail -1`
- |
if [[ "$MODE" == "OnPush" ]]
then
# Get Tag || Get Branch || Alternate Branch Lookup || Get Committ
BRANCHTAG=`echo $TAG | grep . || 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
- echo "Branchtag ${BRANCHTAG}; COMMITDATE=${COMMITDATE}; REPONAME=${REPONAME}; BRANCHNAME=${BRANCHNAME}"
- export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain cdlib-uc3-mrt --domain-owner $AWS_ACCOUNT_ID --region $AWS_REGION --query authorizationToken --output text`
- aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin ${ECR_REGISTRY}
build:
on-failure: ABORT
commands:
- |
docker build --push --quiet \
-t ${ECR_REGISTRY}/merritt-tomcat:dev \
mrt-inttest-services/merritt-tomcat
- |
docker build --push --quiet \
-t ${ECR_REGISTRY}/mock-merritt-it:dev \
mrt-inttest-services/mock-merritt-it
- |
docker build --push --quiet \
-t ${ECR_REGISTRY}/mrt-it-database:dev \
mrt-inttest-services/mrt-it-database
- |
docker build --push --quiet \
-t ${ECR_REGISTRY}/mrt-it-database-audit-replic:dev \
--build-arg LOAD_SQL=/tmp/audit_replic_data.sql \
mrt-inttest-services/mrt-it-database
- |
docker build --push --quiet \
-t ${ECR_REGISTRY}/mrt-minio-it:dev \
mrt-inttest-services/mrt-minio-it
- |
docker build --push --quiet \
-t ${ECR_REGISTRY}/mrt-minio-it-with-content:dev \
--build-arg ECR_REGISTRY=${ECR_REGISTRY} \
mrt-inttest-services/mrt-minio-it-with-content
- |
docker build --push --quiet \
-t ${ECR_REGISTRY}/mrt-database \
mrt-services/mysql
- |
docker build --push --quiet \
-t ${ECR_REGISTRY}/mrt-opendj \
mrt-services/ldap
- |
docker build --push --quiet \
-t ${ECR_REGISTRY}/mrt-init \
mrt-services/merritt-init
- |
docker build --push --quiet \
-t ${ECR_REGISTRY}/callback \
mrt-services/callback