-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild
executable file
·42 lines (37 loc) · 913 Bytes
/
build
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
#!/bin/bash
# Copyright (c) 2015 BITPlan GmbH
#
# see LICENSE
#
# WF 2015-10-18
#
# build the MediaWiki image
#ansi colors
#http://www.csc.uvic.ca/~sae/seng265/fall04/tips/s265s047-tips/bash-using-colors.html
blue='\033[0;34m'
red='\033[0;31m'
green='\033[0;32m' # '\e[1;32m' is too bright for white bg.
endColor='\033[0m'
#
# a colored message
# params:
# 1: l_color - the color of the message
# 2: l_msg - the message to display
#
color_msg() {
local l_color="$1"
local l_msg="$2"
echo -e "${l_color}$l_msg${endColor}"
}
version="0.0.3"
# remember the time we started this
start_date=$(date -u +"%s")
# build the image
docker build -t bitplan/smw:$version \
--build-arg IMAGEHOSTNAME=$(hostname) \
.
# stop the end time
end_date=$(date -u +"%s")
# show how long this took
diff=$(($end_date-$start_date))
color_msg $blue "build took $(($diff / 60)) minutes and $(($diff % 60)) seconds."