-
Notifications
You must be signed in to change notification settings - Fork 184
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
Autogen documentation (no coq_makefile, no dependency on autoreconf) #191
Closed
JasonGross
wants to merge
2
commits into
HoTT:master
from
JasonGross:autogen-doc-no-coqmakefile-no-autoreconf
Closed
Autogen documentation (no coq_makefile, no dependency on autoreconf) #191
JasonGross
wants to merge
2
commits into
HoTT:master
from
JasonGross:autogen-doc-no-coqmakefile-no-autoreconf
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now that we have a `make html` target, we can make the html automatically on travis. If travis builds something which is the same as origin's master, then we autocommit updated documentation and push to the gh-pages branch, where documentation is accessible at http://hott.github.io/HoTT/coqdoc-html/. Generating the files was a pain. I record the process here, so that if we need to update the keys, there will be a reference. First, generate the keys that will be used ```bash $ ROOT="$(git rev-parse --show-toplevel)" $ ssh-keygen -t rsa -C "Travis-CI-bot@travis.fake" -f "$(readlink -f "$ROOT"/etc/ci/id_rsa)" ``` When it prompts you for a passphrase, you must leave it blank. Then add the contents of "$ROOT"/etc/ci/id_rsa.pub as a deploy key to the HoTT repository at https://github.com/HoTT/HoTT/settings/keys. Now, following a modified version of http://about.travis-ci.org/docs/user/travis-pro/#How-can-I-encrypt-files-that-include-sensitive-data%3F, encrypt the id_rsa file: ```bash $ password=`cat /dev/urandom | head -c 10000 | openssl sha1` $ openssl aes-256-cbc -k "$password" -in "$ROOT"/etc/ci/id_rsa -out "$ROOT"/etc/ci/id_rsa.enc -a ``` Now, the hard part (at least if you don't have sudo). Hope that you either have ruby and gem installed, or a version of ssh-keygen which supports the `-e -m` flag combination (check with `ssh-keygen -\?`). If you have ruby and gem, then you can follow http://about.travis-ci.org/docs/user/encryption-keys/, and run ```bash $ gem install travis $ travis encrypt -r HoTT/HoTT "SSHKEY_PASSWORD=$password" ``` and update the `secure:` part of the `.travis.yml` file with the resulting secret. Otherwise, you can follow http://about.travis-ci.org/docs/user/travis-pro/#How-can-I-encrypt-files-that-include-sensitive-data%3F and run ```bash $ \curl https://api.travis-ci.org/repos/HoTT/HoTT/key | perl -pe 's/^{"key"://; s/^"//; s/"}$//' | sed s'/\\n/\n/g' > id_travis.pub $ ssh-keygen -e -m PKCS8 -f id_travis.pub > id_travis.pub.pem $ echo "SSHKEY_PASSWORD='$password'" | openssl rsautl -encrypt -pubin -inkey id_travis.pub.pem ``` However, if `ssh-keygen` fails, complaining about `-m` being unrecognized, then you must clone or copy https://gist.github.com/thwarted/1024558 (https://gist.github.com/1024558.git), install the required python dependencies (for me, pyasn1), and then run that on `id_travis.pub` to get the `id_travis.pub.pem` file, and then run the `openssl rsautl` commmand. Either way, the output of that third command should be placed in the `.travis.yml` file, replacing the existing secret. Perhaps we should include these instructions somewhere in the repository?
This is a much simpler way of doing things. Now that we have a `make html` target, we can make the html automatically on travis. If travis builds something which is the same as origin's master, then we autocommit updated documentation and push to the gh-pages branch, where documentation is accessible at http://hott.github.io/HoTT/coqdoc-html/. Generating the files was much less of a pain. I record the process here, so that if we need to update the keys, there will be a reference. First, generate the OAuth token that will be used, replacing '<username>' with your username. You must have permission to push to HoTT/HoTT. ```bash $ TOKEN="$(curl -u '<username>' -d '{"scopes":["repo"],"note":"For Travis-CI Bot"}' https://api.github.com/authorizations | grep -o 'token": "[^"]*' | sed s'/token": "//g')" ``` It will prompt you for your password. Now, the hard part (at least if you don't have sudo). Hope that you either have ruby and gem installed, or a version of ssh-keygen which supports the `-e -m` flag combination (check with `ssh-keygen -\?`). If you have ruby and gem, then you can follow http://about.travis-ci.org/docs/user/encryption-keys/, and run ```bash $ gem install travis $ travis encrypt -r HoTT/HoTT "OAUTH_TOKEN=$TOKEN" ``` and update the `secure:` part of the `.travis.yml` file with the resulting secret. Otherwise, you can follow http://about.travis-ci.org/docs/user/travis-pro/#How-can-I-encrypt-files-that-include-sensitive-data%3F and run ```bash $ \curl https://api.travis-ci.org/repos/HoTT/HoTT/key | perl -pe 's/^{"key"://; s/^"//; s/"}$//' | sed s'/\\n/\n/g' > id_travis.pub $ ssh-keygen -e -m PKCS8 -f id_travis.pub > id_travis.pub.pem $ echo "OAUTH_TOKEN=$TOKEN" | openssl rsautl -encrypt -pubin -inkey id_travis.pub.pem ``` However, if `ssh-keygen` fails, complaining about `-m` being unrecognized, then you must clone or copy https://gist.github.com/thwarted/1024558 (https://gist.github.com/1024558.git), install the required python dependencies (for me, pyasn1), and then run that on `id_travis.pub` to get the `id_travis.pub.pem` file, and then run the `openssl rsautl` commmand. Either way, the output of that third command should be placed in the `.travis.yml` file, replacing the existing secret. Perhaps we should include these instructions somewhere in the repository?
Merged
Merged with #198 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now that we have a
make html
target, we can make the html automatically on travis. If travis builds something which is the same as origin's master, then we autocommit updated documentation and push to the gh-pages branch, where documentation is accessible at http://hott.github.io/HoTT/coqdoc-html/.Generating the files was a pain. I record the process here, so that if we need to update the keys, there will be a reference.
First, generate the keys that will be used
When it prompts you for a passphrase, you must leave it blank.
Then add the contents of ./id_rsa.pub as a deploy key to the HoTT repository at https://github.com/HoTT/HoTT/settings/keys.
Now, following a modified version of http://about.travis-ci.org/docs/user/travis-pro/#How-can-I-encrypt-files-that-include-sensitive-data%3F, encrypt the id_rsa file:
Now, the hard part (at least if you don't have sudo). Hope that you either have ruby and gem installed, or a version of ssh-keygen which supports the
-e -m
flag combination (check withssh-keygen -\?
). If you have ruby and gem, then you can follow http://about.travis-ci.org/docs/user/encryption-keys/, and run$ gem install travis $ travis encrypt -r HoTT/HoTT "SSHKEY_PASSWORD=$password"
and update the
secure:
part of the.travis.yml
file with the resulting secret. Otherwise, you can follow http://about.travis-ci.org/docs/user/travis-pro/#How-can-I-encrypt-files-that-include-sensitive-data%3F and runHowever, if
ssh-keygen
fails, complaining about-m
being unrecognized, then you must clone or copy https://gist.github.com/thwarted/1024558 (https://gist.github.com/1024558.git), install the required python dependencies (for me, pyasn1), and then run that onid_travis.pub
to get theid_travis.pub.pem
file, and then run theopenssl rsautl
commmand. Either way, the output of that third command should be placed in the.travis.yml
file, replacing the existing secret.Perhaps we should include these instructions somewhere in the repository?