forked from OSGeo/gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·53 lines (43 loc) · 1.35 KB
/
build.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
#!/bin/sh
# This file is available at the option of the licensee under:
# Public domain
# or licensed under MIT (LICENSE.TXT) Copyright 2019 Even Rouault <[email protected]>
set -eu
SCRIPT_DIR=$(dirname "$0")
case $SCRIPT_DIR in
"/"*)
;;
".")
SCRIPT_DIR=$(pwd)
;;
*)
SCRIPT_DIR=$(pwd)/$(dirname "$0")
;;
esac
export SCRIPT_DIR
TAG_NAME=$(basename "${SCRIPT_DIR}")
export TARGET_IMAGE=${TARGET_IMAGE:-osgeo/gdal:${TAG_NAME}}
HAS_PLATFORM=0
if echo "$*" | grep "\-\-platform" > /dev/null; then
HAS_PLATFORM=1
fi
HAS_RELEASE=0
if echo "$*" | grep "\-\-release" > /dev/null; then
HAS_RELEASE=1
fi
HAS_PUSH=0
if echo "$*" | grep "\-\-push" > /dev/null; then
HAS_PUSH=1
fi
"${SCRIPT_DIR}/../util.sh" "$@" --test-python
if test "${HAS_PLATFORM}" = "0" -a "${HAS_RELEASE}" = "0" -a "x${TARGET_IMAGE}" = "xosgeo/gdal:ubuntu-small"; then
"${SCRIPT_DIR}/../util.sh" --platform linux/arm64 "$@" --test-python
if test "$HAS_PUSH" = "1"; then
DOCKER_REPO=$(cat /tmp/gdal_docker_repo.txt)
docker manifest rm ${DOCKER_REPO}/${TARGET_IMAGE}-latest || /bin/true
docker manifest create ${DOCKER_REPO}/${TARGET_IMAGE}-latest \
--amend ${DOCKER_REPO}/${TARGET_IMAGE}-latest-amd64 \
--amend ${DOCKER_REPO}/${TARGET_IMAGE}-latest-arm64
docker manifest push ${DOCKER_REPO}/${TARGET_IMAGE}-latest
fi
fi