Skip to content
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

docs: refactoring doc scripts #1743

Merged
merged 11 commits into from
Oct 27, 2016
Merged

docs: refactoring doc scripts #1743

merged 11 commits into from
Oct 27, 2016

Conversation

callmehiphop
Copy link
Contributor

@callmehiphop callmehiphop commented Oct 22, 2016

closes #1618

This essentially let's us generate JSON for arbitrary releases since we often can't count on Travis to do this in a timely fashion.

Example:

$ npm run docs bigquery 0.6.0

The script does not automatically commit/push anymore however. This will be up to the user to manually do (I still need to tie this into our .travis.yml) and they'll also have to clean up the submodule used to push the docs.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 22, 2016
@stephenplusplus
Copy link
Contributor

Does this resolve #1618?

@callmehiphop
Copy link
Contributor Author

@stephenplusplus I think this should be good to go if you care to take a look!

@@ -21,7 +21,24 @@ before_script:
fi
script: "node ./scripts/build.js"
after_success:
- if [ $IS_PUSH_TO_MASTER ]; then
node ./scripts/build-docs.js;
- if [ $IS_PUSH_TO_MASTER && "${TRAVIS_JOB_NUMBER}" == *1 ]; then

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus
Copy link
Contributor

If this resolves #1618, can you outline what the workflow is for updating the docs website is and pop it in CONTRIBUTING?

@callmehiphop
Copy link
Contributor Author

@stephenplusplus I've updated the CONTRIBUTING guide, you can preview it on my fork.

@stephenplusplus
Copy link
Contributor

Thank you, the write up is awesome. But, is it possible to have a command that does all that for us, right up until the git push?

@callmehiphop
Copy link
Contributor Author

So you want to automate this

$ git submodule add -b gh-pages git@github.com:GoogleCloudPlatform/google-cloud-node.git
$ rm -rf docs/json
$ npm run docs google-cloud 0.43.0
$ cp -rf docs/json/* gh-pages/json
$ cp docs/manifest.json gh-pages
$ cd gh-pages
$ git add .
$ git commit -m 'Update docs for google-cloud 0.43.0 [ci skip]'

?

@stephenplusplus
Copy link
Contributor

Yeah, one command and then manual push to origin.

@callmehiphop
Copy link
Contributor Author

Done, PTAL.

Finally the last thing to do is cleanup the submodule we created to copy over the JSON.

```sh
$ git submodule deinit -f gh-pages

This comment was marked as spam.

This comment was marked as spam.

@callmehiphop
Copy link
Contributor Author

callmehiphop commented Oct 25, 2016

Does this resolve #1618?

Yep


All of the documentation is powered by JSDoc, we parse it into JSON and feed it to an [application](https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/site) built in Angular. Hopefully our CI builds and updates the documentation for each successful merge to master, but if for whatever reason a manual update is required please refer to the following steps.

We can build the documentation using the `npm run prepare-docs` command. This command optionally accepts two parameters.

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus stephenplusplus merged commit feb8b59 into googleapis:master Oct 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow manual override for updating & publishing docs
3 participants