generated from stactools-packages/template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild
executable file
·65 lines (56 loc) · 1.5 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
set -e
if [[ -n "${STACTOOLS_DEBUG}" ]]; then
set -x
fi
set -a # export all variables
source docker_env
set +a
function usage() {
echo -n \
"Usage: $(basename "$0")
Builds project containers. Must be run from the repository root
Options:
--pull Attempt to pull upstream images before building
"
}
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--help)
usage
exit 0
shift
;;
--pull)
PULL="--pull"
shift
;;
esac
done
if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
if [ "${1:-}" = "--help" ]; then
usage
else
docker build $PULL \
--build-arg DOCKER_WORKDIR \
-t stactools-${DOCKER_REPO}-script-runner \
-f docker/Dockerfile-script-runner .
STACTOOLS_VERSION=$(docker/run-script python scripts/stactools-version.py)
echo "Building with stactools version $STACTOOLS_VERSION"
docker build $PULL \
--build-arg STACTOOLS_VERSION \
--build-arg DOCKER_WORKDIR \
--build-arg DOCKER_NAMESPACE_PACKAGE_DIR \
-t $DOCKER_REGISTRY/$DOCKER_ORG/$DOCKER_REPO:$DOCKER_TAG \
-f docker/Dockerfile .
docker build $PULL \
--build-arg STACTOOLS_VERSION \
--build-arg DOCKER_WORKDIR \
--build-arg DOCKER_NAMESPACE_PACKAGE_DIR \
-t $DOCKER_REGISTRY/$DOCKER_ORG/$DOCKER_REPO:$DOCKER_TAG_DEV \
-f docker/Dockerfile-dev .
fi
exit
fi