-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
118 lines (83 loc) · 5.43 KB
/
Makefile
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
SHELL:=/bin/bash
include .env
.PHONY: all clean tzdata tzrearguard zoneinfo website rsync rsync-outlook
TARGET=$(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))
all: zoneinfo
clean:
rm -rf tzdb/tzdata$(TZDB_VERSION)/ && \
rm -rf tzdb/tzdata$(TZDB_VERSION)-rearguard/ && \
rm -rf tzdb/tzdb-$(TZDB_VERSION)/
tzdata:
mkdir -p tzdb/tzdata$(TZDB_VERSION) && \
curl -L $(TZDB_BASE_URL)tzdata$(TZDB_VERSION).tar.gz | tar -zxC tzdb/tzdata$(TZDB_VERSION)
tzrearguard:
mkdir -p tzdb/tzdata$(TZDB_VERSION)-rearguard && \
curl -L $(TZDB_BASE_URL)tzdb-$(TZDB_VERSION).tar.lz | tar --lzip -xC tzdb
cd tzdb/tzdb-$(TZDB_VERSION) && make rearguard_tarballs && \
tar -zxf tzdata$(TZDB_VERSION)-rearguard.tar.gz -C ../tzdata$(TZDB_VERSION)-rearguard
vzicbuild:
rm -rf vzic/vzic-master && mkdir -p vzic && \
curl -L --output vzic/vzic-master.zip https://github.com/libical/vzic/archive/master.zip && \
unzip vzic/vzic-master.zip -d vzic
zoneinfo: tzdata tzrearguard
rm -rf http https && mkdir -p http https
cd vzic/vzic-master && \
OLSON_DIR=$(OLSON_DIR) PRODUCT_ID="$(PRODUCT_ID)" TZID_PREFIX="" make -B
./vzic/vzic-master/vzic --pure --output-dir http/zoneinfo --url-prefix http://www.tzurl.org/zoneinfo && \
./vzic/vzic-master/vzic --output-dir http/zoneinfo-outlook --url-prefix http://www.tzurl.org/zoneinfo-outlook
./vzic/vzic-master/vzic --pure --output-dir https/zoneinfo --url-prefix https://www.tzurl.org/zoneinfo && \
./vzic/vzic-master/vzic --output-dir https/zoneinfo-outlook --url-prefix https://www.tzurl.org/zoneinfo-outlook
cd vzic/vzic-master && \
OLSON_DIR=$(OLSON_DIR) PRODUCT_ID="$(PRODUCT_ID)" TZID_PREFIX=$(TZID_PREFIX) make -B
./vzic/vzic-master/vzic --pure --output-dir http/zoneinfo-global --url-prefix http://www.tzurl.org/zoneinfo-global && \
./vzic/vzic-master/vzic --output-dir http/zoneinfo-outlook-global --url-prefix http://www.tzurl.org/zoneinfo-outlook-global
./vzic/vzic-master/vzic --pure --output-dir https/zoneinfo-global --url-prefix https://www.tzurl.org/zoneinfo-global && \
./vzic/vzic-master/vzic --output-dir https/zoneinfo-outlook-global --url-prefix https://www.tzurl.org/zoneinfo-outlook-global
website:
website/generate-available-ids.sh http/zoneinfo && \
website/generate-directory-listing.sh http/zoneinfo
website/generate-available-ids.sh http/zoneinfo-global && \
website/generate-directory-listing.sh http/zoneinfo-global
website/generate-available-ids.sh http/zoneinfo-outlook && \
website/generate-directory-listing.sh http/zoneinfo-outlook
website/generate-available-ids.sh http/zoneinfo-outlook-global && \
website/generate-directory-listing.sh http/zoneinfo-outlook-global
website/generate-available-ids.sh https/zoneinfo && \
website/generate-directory-listing.sh https/zoneinfo
website/generate-available-ids.sh https/zoneinfo-global && \
website/generate-directory-listing.sh https/zoneinfo-global
website/generate-available-ids.sh https/zoneinfo-outlook && \
website/generate-directory-listing.sh https/zoneinfo-outlook
website/generate-available-ids.sh https/zoneinfo-outlook-global && \
website/generate-directory-listing.sh https/zoneinfo-outlook-global
tzalias:
awk '/^Link/ {print $$3,"="$$2}' tzdb/tzdata$(TZDB_VERSION)-rearguard/backward > tz.alias
upload:
AWS_PROFILE=$(AWS_PROFILE) aws s3 sync --endpoint=$(AWS_ENDPOINT) --acl public-read https/zoneinfo-global $(TZURL_BUCKET)/zoneinfo-global
AWS_PROFILE=$(AWS_PROFILE) aws s3 sync --endpoint=$(AWS_ENDPOINT) --acl public-read https/zoneinfo-outlook-global $(TZURL_BUCKET)/zoneinfo-outlook-global
AWS_PROFILE=$(AWS_PROFILE) aws s3 sync --endpoint=$(AWS_ENDPOINT) --acl public-read https/zoneinfo-outlook $(TZURL_BUCKET)/zoneinfo-outlook
AWS_PROFILE=$(AWS_PROFILE) aws s3 sync --endpoint=$(AWS_ENDPOINT) --acl public-read https/zoneinfo $(TZURL_BUCKET)/zoneinfo
AWS_PROFILE=$(AWS_PROFILE) aws s3 sync --endpoint=$(AWS_ENDPOINT) --acl public-read website/images $(TZURL_BUCKET)/images
AWS_PROFILE=$(AWS_PROFILE) aws s3 cp --endpoint=$(AWS_ENDPOINT) --acl public-read website/index.html $(TZURL_BUCKET)/
rsync:
rsync -av --delete --copy-links https/zoneinfo $(TARGET) && \
rsync -av --delete --copy-links https/zoneinfo-global $(TARGET)
rsync-outlook:
rsync -av --delete --copy-links https/zoneinfo-outlook $(TARGET) && \
rsync -av --delete --copy-links https/zoneinfo-outlook-global $(TARGET)
build:
docker build -t $(REGISTRY)/tzurl:amd64 --build-arg ARCH=amd64/ . && \
docker build -t $(REGISTRY)/tzurl:arm64v8 --build-arg ARCH=arm64v8/ .
test: build
#docker run --rm -it -e STATIC_HOST=localhost:8080 -p8080:80 ical4j/tzurl-nginx
docker run --rm -it -p8080:80 $(REGISTRY)/tzurl
tag:
echo $(TAGS) | tr "/," "-\n" | xargs -n1 -I % docker tag $(REGISTRY)/tzurl:amd64 $(REGISTRY)/tzurl:amd64-% && \
echo $(TAGS) | tr "/," "-\n" | xargs -n1 -I % docker tag $(REGISTRY)/tzurl:arm64v8 $(REGISTRY)/tzurl:arm64v8-%
# echo $(TAGS) | tr "/," "-\n" | xargs -n1 -I % docker tag $(REGISTRY)/tzurl $(REGISTRY)/tzurl:%
push:
echo $(TAGS) | tr "/," "-\n" | xargs -n1 -I % docker push $(REGISTRY)/tzurl:amd64-% && \
echo $(TAGS) | tr "/," "-\n" | xargs -n1 -I % docker push $(REGISTRY)/tzurl:arm64v8-% && \
echo $(TAGS) | tr "/," "-\n" | xargs -n1 -I % docker manifest create $(REGISTRY)/tzurl:% --amend $(REGISTRY)/tzurl:amd64-% --amend $(REGISTRY)/tzurl:arm64v8-% && \
echo $(TAGS) | tr "/," "-\n" | xargs -n1 -I % docker manifest push $(REGISTRY)/tzurl:%
# echo $(TAGS) | tr "/," "-\n" | xargs -n1 -I % docker push $(REGISTRY)/tzurl:%