forked from riccardo-ferrari/liferay-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_local_image.sh
executable file
·50 lines (36 loc) · 1007 Bytes
/
build_local_image.sh
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
#!/bin/bash
source ./_common.sh
function build_docker_image {
local docker_image_name=${2}
local release_version=${3}
docker build \
--build-arg LABEL_BUILD_DATE=$(date "${CURRENT_DATE}" "+%Y-%m-%dT%H:%M:%SZ") \
--build-arg LABEL_NAME="${docker_image_name}-${release_version}" \
--build-arg LABEL_VCS_REF=$(git rev-parse HEAD) \
--build-arg LABEL_VERSION="${release_version}" \
--tag liferay/${docker_image_name}:${release_version}-${TIMESTAMP} \
--tag liferay/${docker_image_name}:${release_version} \
${TEMP_DIR}
}
function check_usage {
if [ ! -n "${3}" ]
then
echo "Usage: ${0} path-to-bundle image-name version"
echo ""
echo "Example: ${0} ../bundles/master portal-snapshot demo-cbe09fb0"
exit 1
fi
check_utils curl docker java
}
function main {
check_usage ${@}
make_temp_directory
prepare_temp_directory ${@}
prepare_tomcat
build_docker_image ${@}
clean_up_temp_directory
}
function prepare_temp_directory {
cp -a ${1} ${TEMP_DIR}/liferay
}
main ${@}