[Prototype] Allow users to deploy on their own fork/PR#176
Conversation
This is only the first half (and still draft), instead of commiting the encryption key, it base64 encode it and set it on travis-ci using the API. The second part would be to detect that the env variable is set and trigger the right behavior, which imho is to deploy the current branch on `<user-fork>:gh-pages` branch, under a `docs-$BRANCHNAME` subfolder. WE can't do `$PRNUMBER` as branch will be deployed from the users run of travis on not from the PR one.
| deploy_parser.set_defaults(func=deploy) | ||
| deploy_parser_add_argument = make_parser_with_config_adder(deploy_parser, config) | ||
|
|
||
| _user_fork_parser = subcommand.add_parser('fork-deploy', help="""Deploy the docs to GitHub from Travis to the current user fork""") |
There was a problem hiding this comment.
Shouldn't it use the same command (doctr deploy), so that users can enable it and have it just work with the same .travis.yml as the main repo?
There was a problem hiding this comment.
No, it could also be doctr-configure, but this command have to be run on user machine.
I'm planning on having doctr deploy do automatically the right things is the USER_DEPLOY env variable is set.
There was a problem hiding this comment.
Oh, then it should be called doctr configure-fork or something like that. Right now this looks like the deploy command, which gets run on Travis only.
There was a problem hiding this comment.
Or maybe just doctr configure --fork.
|
|
||
| header = "\n================== You should now do the following ==================\n" | ||
|
|
||
| if args.token: |
There was a problem hiding this comment.
You can leave this not implemented if you want. Tokens are less secure (they grant access to all the user's repos), and should really only be used for dedicated bot users (which won't be the case here).
There was a problem hiding this comment.
Yes, thanks, I'll clean things up, I'm just prototyping by copy-pasting for now.
This is only the first half (and still draft), instead of commiting the
encryption key, it base64 encode it and set it on travis-ci using the
API.
The second part would be to detect that the env variable is set and
trigger the right behavior, which imho is to deploy the current branch
on
<user-fork>:gh-pagesbranch, under adocs-$BRANCHNAMEsubfolder.WE can't do
$PRNUMBERas branch will be deployed from the users run oftravis on not from the PR one.
--
There is quite a bit of refactoring and code sharing to do, but not today.