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
Deploy development documentation from Travis [not ready to merge] #3939
Conversation
I guess this fails because the key is encrypted for my Travis repository and not the main Matplotlib one. |
git config --global push.default simple | ||
git add . | ||
git commit -m "Docs build of $TRAVIS_COMMIT" | ||
git push |
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.
I think if you do git checkout --orphan gh-pages
than this will create an orphaned commit, meaning it has no parent. That way, this repository won't grow to an an unwieldy size. I don't think there's any need to keep history here.
This is a great idea. Thanks for working on it. A couple of things: It seems like the versions.html section isn't being included in either http://jenshnielsen.github.io/mplddocs/index.html or http://jenshnielsen.github.io/matplotlibdocs/. (I didn't investigate further). The little blurb that says "This is the documentation for 1.5.x" maybe should say "git master" or something? Other than that, I think this is great. I think it's an important feature that the docs are in a separate repository from either |
a47ae34
to
b97fa1b
Compare
@mdboom I was trying to deploy the pages within a subpage of my github repository. Still needs to be done:
|
|
Sure, I thought that versions.html was excluded on purpose since all versions of the documentation should ajax load the one from the webroot to have consistent links across versions. Anyway the following files and dirs are in the root of matplotlib.github.com and not in the docs build
which together total are used to generate:
And
|
http://jenshnielsen.github.io/ looks good now. Thanks! Let us know what you need from us in terms of keys etc. |
a7c2bbd
to
813ebdd
Compare
@mdboom The secrets to decrypt the keys are now stored in the Matplotlib Travis instance (I apparently had sufficient permissions to do that) The only thing needed now is to create a repository within the matplotlib organisation to upload the devel documentation (mirroring jenshnielsen/mplddocs but should probably be called something better) Then we need to add the following public key as a deploy key for this repository:
When that repository is created I can modify .travis.yml to point to that repository. As a last thing I will open a pr against the main documentation repository to add a link to the development documentation. |
@jenshnielsen I have created https://github.com/matplotlib/devdocs for this purpose. |
Following successful build from github
The key is only used to upload docs so no need to dectrypt it otherwise
813ebdd
to
5c917f3
Compare
Thanks, I changed .travis.yml to point to that repository. Provided that the public key above has been added as a deploy key to that repository this should be ready. Unfortunately there is no real way to test this in full before merged to master since it only runs on the master branch. But it does work (with modifications) on my master branch |
What's the worst that can happen... |
DOC/BLD : Deploy development documentation from Travis
Since everything is in a after_success block I don't think that it can fail the build |
Still doesn't work i.e https://travis-ci.org/matplotlib/matplotlib/builds/46665810 fails to upload. The key is correctly decrypted so the matplotlib travis user has the correct secrets but it appears not to have the correct permissions to push to the repository. The specific error is:
Which is rather odd since I have no idea where jenshnielsen/mplddocs is coming from now. @tacaswell is the public key above added to deployment keys for the devdocs repository? If so I guess that I should try generating a new key which has not been associated with my repository. |
Part of it was probably permission errors on the gh side. The developer group did not have access to the devdoc repo |
@jenshnielsen Can you use that public key to push to devdocs from your local machine? |
Nope looks like I get the same error. Did you add it as a deployment key? I.e. Go to the devdocs / settings of the repository / Deploy keys / and add it there? I created this key specifically for this purpose and it should only have rights to push to that repository to limit the scope of what can be done automatically. |
@jenshnielsen: I went to the |
I guess I missed the fact that a deployment key can only be used for one repository, which I guess makes sense from a security point of view, I deleted the key from jenshnielsen/mplddocs and added it here. That seemed to be allowed. I have now restated the latest docs build of master on travis. Lets see if that works. (here https://travis-ci.org/matplotlib/matplotlib/jobs/46724819) |
Looks like it worked up here at http://matplotlib.org/devdocs/ and https://github.com/matplotlib/devdocs/tree/gh-pages Thanks for the help @mdboom and @tacaswell |
This is as much to get some input and see if this makes any sense as a final pull request.
The idea is to upload the documentation build by Travis on the master branch to a git repository on the gh-pages branch. For security this is done in a separate repository from the main code. Travis stores an encrypted private deployment key which can only be used to upload to this repository. According to the travis docs this key can only be decrypted on a main branch and not a PR to protect against leaks.
See http://docs.travis-ci.com/user/deployment/custom/ for the Travis documentation
I imaging that this should be linked from the main list of version on matplotlib.org For this to work as intended it will also require modification of versions.html in the main repository to use absolute rather than relative links and point to this version.
I originally tried using a submodule but that will require modifying the main repo when a new branch is pushed
to link it to the tip of the dev repository.
The one that I am currently building can be seen at http://jenshnielsen.github.io/mplddocs/index.html (Builds every time that I push against the master branch of my mpl fork)
And my fork of the main documentation at http://jenshnielsen.github.io/matplotlibdocs/ with links to the development docs
What do you think? Does it make any sense to upload the development documentation?