Skip to content

Commit 7f9fab6

Browse files
committed
feat(Makefile): retry discovery-url five times
1 parent 5c36bca commit 7f9fab6

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,19 @@ dev-cluster: discovery-url
3131
deisctl install platform
3232

3333
discovery-url:
34-
sed -e "s,discovery #DISCOVERY_URL,discovery $$(curl -s -w '\n' https://discovery.etcd.io/new?size=$$DEIS_NUM_INSTANCES)," contrib/coreos/user-data.example > contrib/coreos/user-data
34+
@for i in 1 2 3 4 5; do \
35+
URL=`curl -s -w '\n' https://discovery.etcd.io/new?size=$$DEIS_NUM_INSTANCES`; \
36+
if [ ! -z $$URL ]; then \
37+
sed -e "s,discovery #DISCOVERY_URL,discovery $$URL," contrib/coreos/user-data.example > contrib/coreos/user-data; \
38+
echo "Wrote $$URL to contrib/coreos/user-data"; \
39+
break; \
40+
fi; \
41+
if [ $$i -eq 5 ]; then \
42+
echo "Failed to contact https://discovery.etcd.io after $$i tries"; \
43+
else \
44+
sleep 3; \
45+
fi \
46+
done
3547

3648
build: check-docker
3749
@$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) build &&) echo done

0 commit comments

Comments
 (0)