Newer
Older
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
#!/usr/bin/env bash
# ----------------------------------------------------------
# PURPOSE
# This is the build script for eris-db. It will build the
# tool into docker containers in a reliable and predicatable
# manner.
# ----------------------------------------------------------
# REQUIREMENTS
# docker installed locally
# ----------------------------------------------------------
# USAGE
# build_tool.sh
# ----------------------------------------------------------
# Set defaults
set -e
start=`pwd`
if [ "$CIRCLE_BRANCH" ]
then
repo=`pwd`
else
base=github.com/eris-ltd/eris-db
repo=$GOPATH/src/$base
fi
branch=${CIRCLE_BRANCH:=master}
branch=${branch/-/_}
release_min=$(cat $repo/version/version.go | tail -n 1 | cut -d \ -f 4 | tr -d '"')
release_maj=$(echo $release_min | cut -d . -f 1-2)
image_base=quay.io/eris/erisdb
cd $repo
if [[ "$branch" = "master" ]]
then
docker build -t $image_base:latest $repo
docker tag $image_base:latest $image_base:$release_maj
docker tag $image_base:latest $image_base:$release_min
else
docker build -t $image_base:$release_min $repo
fi
test_exit=$?
cd $start