Skip to content
Snippets Groups Projects
Commit 2414cdd3 authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Fixes discovery

parent 5ff97690
No related branches found
No related tags found
No related merge requests found
...@@ -11,10 +11,14 @@ BindsTo=universal@%i.service ...@@ -11,10 +11,14 @@ BindsTo=universal@%i.service
Type=oneshot Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
Environment=URL=%i Environment=URL=%i
ExecStart=/bin/bash -euxc ' \ ExecStart=/bin/bash -xc ' \
sleep 3; \ ip=""; \
container_name=`echo ${URL}_web_1 | sed "s/\.//g" | sed "s/-//g"`; \ while [ -z $ip ]; \
ip=`docker inspect --format \'{{.NetworkSettings.IPAddress}}\' $container_name`; \ do \
container_name=`echo ${URL}_web_1 | sed "s/\.//g" | sed "s/-//g"`; \
ip=`docker inspect --format \'{{.NetworkSettings.IPAddress}}\' $container_name`; \
sleep 1; \
done; \
etcdctl --peers 172.17.42.1:4001 set /services/web/%i \'{"ip":"\'$ip\'", "port":"80"}\';' etcdctl --peers 172.17.42.1:4001 set /services/web/%i \'{"ip":"\'$ip\'", "port":"80"}\';'
ExecStop=-/usr/bin/etcdctl rm /services/web/%i ExecStop=-/usr/bin/etcdctl rm /services/web/%i
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment