Skip to content

Commit 02eec33

Browse files
committed
Use application name property from manifest.yml to allow app to be called other than 'letsencrypt'
1 parent 2863edf commit 02eec33

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

setup-app.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
with open('domains.yml') as data_file:
55
settings = yaml.safe_load(data_file)
66

7+
with open('manifest.yml') as manifest_file:
8+
manifest = yaml.safe_load(manifest_file)
9+
710
print settings
11+
appname = manifest['applications'][0]['name']
812

913
# Push the app, but don't start it yet
1014
call(["cf", "push", "--no-start"])
@@ -14,9 +18,9 @@
1418
domain = entry['domain']
1519
for host in entry['hosts']:
1620
if host == '.':
17-
call(["cf", "map-route", "letsencrypt", domain, "--path", "/.well-known/acme-challenge/"])
21+
call(["cf", "map-route", appname, domain, "--path", "/.well-known/acme-challenge/"])
1822
else:
19-
call(["cf", "map-route", "letsencrypt", domain, "--hostname", host, "--path", "/.well-known/acme-challenge/"])
23+
call(["cf", "map-route", appname, domain, "--hostname", host, "--path", "/.well-known/acme-challenge/"])
2024

2125
# Now the app can be started
22-
call(["cf", "start", "letsencrypt"])
26+
call(["cf", "start", appname])

0 commit comments

Comments
 (0)