Skip to content

Commit

Permalink
Use application name property from manifest.yml to allow app to be ca…
Browse files Browse the repository at this point in the history
…lled other than 'letsencrypt'
  • Loading branch information
bsyk committed Mar 26, 2016
1 parent 2863edf commit 02eec33
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions setup-app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
with open('domains.yml') as data_file:
settings = yaml.safe_load(data_file)

with open('manifest.yml') as manifest_file:
manifest = yaml.safe_load(manifest_file)

print settings
appname = manifest['applications'][0]['name']

# Push the app, but don't start it yet
call(["cf", "push", "--no-start"])
Expand All @@ -14,9 +18,9 @@
domain = entry['domain']
for host in entry['hosts']:
if host == '.':
call(["cf", "map-route", "letsencrypt", domain, "--path", "/.well-known/acme-challenge/"])
call(["cf", "map-route", appname, domain, "--path", "/.well-known/acme-challenge/"])
else:
call(["cf", "map-route", "letsencrypt", domain, "--hostname", host, "--path", "/.well-known/acme-challenge/"])
call(["cf", "map-route", appname, domain, "--hostname", host, "--path", "/.well-known/acme-challenge/"])

# Now the app can be started
call(["cf", "start", "letsencrypt"])
call(["cf", "start", appname])

0 comments on commit 02eec33

Please sign in to comment.