-
Notifications
You must be signed in to change notification settings - Fork 3
/
taginfo_genconfig.sh
executable file
·64 lines (51 loc) · 1.83 KB
/
taginfo_genconfig.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
56
57
58
59
60
61
62
63
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
CONTINENT_LONG=$1
CONTINENT=$2
START_PORT=$3
DOMAIN=$(cat DOMAIN)
ISO_FILTER=$4
ISO_SERVICE_FILTER=$5
echo ":: clean directory"
docker-compose run --rm -T taginfo_dev rm -rf /osm/service/$CONTINENT
mkdir -p ./service/$CONTINENT/
log_file=./service/$CONTINENT/taginfo_genconfig.log
rm -f $log_file
# backup log from here ...
exec &> >(tee -a "$log_file")
STARTTIME=$(date +%s)
STARTDATE=$(date +"%Y%m%dT%H%M")
echo "========================================="
echo "DATETIME=$STARTDATE $STARTTIME"
echo "CONTINENT_LONG=$CONTINENT_LONG"
echo "CONTINENT=$CONTINENT"
echo "START_PORT=$START_PORT"
echo "DOMAIN=$DOMAIN"
echo "ISO_FILTER=$ISO_FILTER"
echo "ISO_SERVICE_FILTER=$ISO_SERVICE_FILTER"
echo "========================================="
echo ":: gen new configs"
docker-compose run \
-e CONTINENT_LONG=$CONTINENT_LONG \
-e CONTINENT=$CONTINENT \
-e DOMAIN=$DOMAIN \
-e START_PORT=$START_PORT \
-e ISO_FILTER="${ISO_FILTER}" \
-e ISO_SERVICE_FILTER="${ISO_SERVICE_FILTER}" \
--rm \
-T \
taginfo_dev /osm/setup/r_admin.sh
echo ":: generated services"
cat ./service/$CONTINENT/service_create.sh
echo ":: clean temp poly/img/log files"
rm -f ./service/$CONTINENT/*/poly/osm.geojson
rm -f ./service/$CONTINENT/*/poly/osm.poly
rm -f ./service/$CONTINENT/*/img/dbackground0.png
rm -f ./service/$CONTINENT/*/img/nebackground*.*
rm -f ./service/$CONTINENT/*/img/tdbackground.png
rm -f ./service/$CONTINENT/*.log
echo ":: copy hugo files"
docker-compose run --rm -T taginfo_dev mkdir -p ./hugo/taginfo/content/$CONTINENT_LONG/
docker-compose run --rm -T taginfo_dev cp ./service/$CONTINENT/service_index.md ./hugo/taginfo/content/$CONTINENT_LONG/index.md