-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for CNAME file when using gh-deploy #285
Conversation
# This GitHub pages repository has a CNAME configured. | ||
with(open('CNAME', 'r')) as f: | ||
cname_host = f.read() | ||
print('Your documentation should be available shortly at: http://' + cname_host) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make more sense to return here rather than indenting everything below?
Good point. I'll go adjust. |
2876a97
to
31427fe
Compare
@d0ugal That simplified it a bit. ;) Let me know how that looks. |
The messaging should also keep in mind that the CNAME file doesn't garuntee it'll be at that hostname. Might we want a 'Assuming your DNS records are setup correctly' prefix? |
31427fe
to
cd3d680
Compare
Another good point. One would assume they would already be configured but... |
@@ -14,7 +14,18 @@ def gh_deploy(config): | |||
except: | |||
return | |||
|
|||
# TODO: Also check for CNAME file | |||
# Does this repository have a CNAME set for GitHub pages? | |||
cname_host = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is redundant.
One minor nit, otherwise LGTM. |
If a CNAME file exists in the gh-pages branch, we should read it and use that URL as the expected GitHub pages location. For branches without a CNAME file, we will try to determine the URL using the origin URL.
cd3d680
to
6b558dd
Compare
Awesome. Just fixed that. |
Check for CNAME file when using gh-deploy
Thanks! |
If a CNAME file exists in the gh-pages branch, we should read it and use that URL as the expected GitHub pages location. For branches without a CNAME file, we will try to determine the URL using the origin URL.