-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from MichaelHatherly/mh/backports
- Loading branch information
Showing
8 changed files
with
101 additions
and
58 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,22 +24,16 @@ package repository: | |
|
||
- travis buildbots startup and run your tests; | ||
- each buildbot will build the package docs using your `docs/make.jl` script; | ||
- a single buildbot will then try to push the generated docs back to github. | ||
- a single buildbot will then try to push the generated docs back to GitHub. | ||
|
||
Note that the hosted documentation does not update when you make pull | ||
requests; you see updates only when you merge to `master` or push new tags. | ||
|
||
The following sections outline how to enable this for your own package. | ||
|
||
## Deploy Keys | ||
## SSH Deploy Keys | ||
|
||
Two methods are available for securely deploying generated documentation from Travis to | ||
GitHub. The first method listed below is the preferred approach. The second, and original, | ||
method should be avoided whenever possible. | ||
|
||
### SSH Deploy Keys | ||
|
||
Deploy keys provide push access to a *single* repository. | ||
Deploy keys provide push access to a *single* repository, to allow secure deployment of generated documentation from Travis to GitHub. | ||
|
||
!!! note | ||
|
||
|
@@ -62,49 +56,52 @@ julia> Travis.genkeys("MyPackage") | |
|
||
where `"MyPackage"` is the name of the package you would like to create deploy keys for. | ||
|
||
You may be asked to enter your password for Travis during this process. Once complete you | ||
will need to add the public key displayed in the REPL to your repository -- just follow the | ||
instructions displayed in the REPL. | ||
If you see a line about adding an `openssl` command to your | ||
`.travis.yml` file, you can ignore that (Documenter will handle that | ||
for you). | ||
You may be asked to enter your password for Travis during this process. After one or two questions, and some other reporting, you may also be told to alter your `.travis.yml` file: | ||
|
||
Then close the REPL and commit the `docs/.documenter.enc` file that was generated by | ||
[`Travis.genkeys`](@ref) to the repository. You can skip the [GitHub Security Tokens](@ref) | ||
section and move straight on to [Travis Environment Settings](@ref) now. | ||
``` | ||
Please add the following to your build script (before_install stage in your .travis.yml, for instance): | ||
If you don't get a `docs/.documenter.enc` file, one possible reason is | ||
an outdated version of `travis`. At the time of this writing, version 1.8.2 | ||
was known to work. | ||
openssl aes-256-cbc -K $encrypted_<something>_key -iv $encrypted_<something>_iv -in .documenter.enc -out .documenter -d | ||
### GitHub Security Tokens | ||
Pro Tip: You can add it automatically by running with --add. | ||
``` | ||
|
||
These tokens provide push access to *every* repository owned by the user. | ||
**Ignore this**. Documenter will handle it for you. | ||
|
||
Firstly, generate a new [personal access token](https://github.com/settings/tokens). | ||
Once complete you will need to add the public key displayed in the REPL to your repository -- just follow the instructions displayed in the REPL: | ||
|
||
Enter a description for this new token. We'll be calling ours "Travis", but any other name | ||
will do. For the "Select scopes" option choose "public_repo" **only**. Then generate the | ||
token and save it somewhere safe. We'll be needing it during the next section. | ||
``` | ||
Make sure to add .documenter.enc to the git repository. | ||
## Travis Environment Settings | ||
Make sure not to add .documenter to the git repository. | ||
Commit all changes to your .travis.yml. | ||
WARNING: removing private key. | ||
### SSH Keys | ||
Add the following public deploy key to '<username>/MyPackage.jl' with write access | ||
If you used [`Travis.genkeys`](@ref) in the previous step then you should go to your Travis | ||
settings page and check that two new keys have been added with names similar to the following | ||
ssh-rsa [...] [email protected] | ||
- `encrypted_e6b49e69746a_key` | ||
- `encrypted_e6b49e69746a_iv` | ||
on the following page: | ||
https://github.com/<username>/MyPackage.jl/settings/keys | ||
### Tokens | ||
Then commit the '.documenter.enc' file. Do not edit '.travis.yml'. | ||
If you generated a GitHub token during the previous step then we'll add the token to our | ||
repository's Travis page. Go to the settings page for the repository and under the | ||
"Environment Variables" section add a new variable called `GITHUB_API_KEY`. Copy the | ||
generated key from the [GitHub Security Tokens](@ref) section as the value and **make sure** | ||
that "Display value in build log" is **off**. Be careful to remove any leading white-space | ||
from the key. Then add the key. | ||
WARNING: removing public key. | ||
``` | ||
|
||
where `<username>` is your GitHub username, or the name of the organization that hosts the package, and `[...]` is the actual public key that has been generated. Once you've added the public deploy key to GitHub, then close the REPL and commit the `docs/.documenter.enc` file that was generated by [`Travis.genkeys`](@ref) to the repository. | ||
|
||
If you don't get a `docs/.documenter.enc` file, one possible reason is | ||
an outdated version of `travis`. At the time of this writing, version 1.8.2 | ||
was known to work. | ||
|
||
## Travis Environment Settings | ||
|
||
You should now go to your Travis settings page and check that two new keys have been added with names similar to the following | ||
|
||
- `encrypted_e6b49e69746a_key` | ||
- `encrypted_e6b49e69746a_iv` | ||
|
||
## `.travis.yml` Configuration | ||
|
||
|
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
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
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
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
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
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