-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·29 lines (25 loc) · 813 Bytes
/
build.sh
File metadata and controls
executable file
·29 lines (25 loc) · 813 Bytes
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
#!/bin/bash
set -e
case "$1" in
"build")
python update.py
# docker build
find . -maxdepth 1 -type d -name '0.*' -exec sh -c 'docker build -t wiktorn/overpass-api:$(basename "$1") -f "$1"/Dockerfile .' sh {} \;
# docker tag
while IFS= read -r -d '' file; do
docker tag "wiktorn/overpass-api:$(basename "$file")" wiktorn/overpass-api:latest
done < <(find . -maxdepth 1 -type d -regex '\./[0-9]\.[0-9]\.[0-9]*' -print0 | sort -nz | tail -z -n 1)
;;
"push")
# docker push
find . -maxdepth 1 -type d -name '0.*' -exec sh -c 'docker push "wiktorn/overpass-api:$(basename "$1")"' sh {} \;
docker push wiktorn/overpass-api:latest
;;
"$1")
echo "Invalid argument $1"
echo "Valid arguments:"
echo "$0 build - to build docker images"
echo "$0 push - to push built images to docker hub"
exit 1
;;
esac