-
Notifications
You must be signed in to change notification settings - Fork 148
/
build_zabbix_server_image.sh
executable file
·55 lines (43 loc) · 1.68 KB
/
build_zabbix_server_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
51
52
53
54
55
#!/bin/bash
source ./_common.sh
function build_docker_image {
local image_version=$(./release_notes.sh get-version)
DOCKER_IMAGE_TAGS=()
DOCKER_IMAGE_TAGS+=("${LIFERAY_DOCKER_REPOSITORY}/zabbix-server:${image_version}-${TIMESTAMP}")
DOCKER_IMAGE_TAGS+=("${LIFERAY_DOCKER_REPOSITORY}/zabbix-server")
if [ "${1}" == "push" ]
then
check_docker_buildx
docker buildx build \
--build-arg LABEL_BUILD_DATE=$(date "${CURRENT_DATE}" "+%Y-%m-%dT%H:%M:%SZ") \
--build-arg LABEL_NAME="Liferay Zabbix Server" \
--build-arg LABEL_VCS_REF=$(git rev-parse HEAD) \
--build-arg LABEL_VCS_URL="https://github.com/liferay/liferay-docker" \
--build-arg LABEL_VERSION="${image_version}" \
--build-arg LABEL_ZABBIX_VERSION="${LIFERAY_DOCKER_ZABBIX_VERSION}" \
--builder "liferay-buildkit" \
--platform "${LIFERAY_DOCKER_IMAGE_PLATFORMS}" \
--push \
$(get_docker_image_tags_args "${DOCKER_IMAGE_TAGS[@]}") \
"${TEMP_DIR}" || exit 1
else
remove_temp_dockerfile_target_platform
docker build \
--build-arg LABEL_BUILD_DATE=$(date "${CURRENT_DATE}" "+%Y-%m-%dT%H:%M:%SZ") \
--build-arg LABEL_NAME="Liferay Zabbix Server" \
--build-arg LABEL_VCS_REF=$(git rev-parse HEAD) \
--build-arg LABEL_VCS_URL="https://github.com/liferay/liferay-docker" \
--build-arg LABEL_VERSION="${image_version}" \
--build-arg LABEL_ZABBIX_VERSION="${LIFERAY_DOCKER_ZABBIX_VERSION}" \
$(get_docker_image_tags_args "${DOCKER_IMAGE_TAGS[@]}") \
"${TEMP_DIR}" || exit 1
fi
}
function main {
delete_local_images "${LIFERAY_DOCKER_REPOSITORY}/zabbix-server"
make_temp_directory templates/zabbix-server
log_in_to_docker_hub
build_docker_image "${1}"
clean_up_temp_directory
}
main "${@}"