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

Use Github API to update the docs #2101

Merged
merged 2 commits into from
Apr 17, 2022

Conversation

frankywahl
Copy link
Contributor

Instead of a hard-coded version of the docs we want to realease, this
uses the Github API to get the last 20 versions and publish those. This
will allow any script invoking this to make sure to always have the
latest version of the docs

Instead of a hard-coded version of the docs we want to realease, this
uses the Github API to get the last 20 versions and publish those. This
will allow any script invoking this to make sure to always have the
latest version of the docs
@coveralls
Copy link

coveralls commented Apr 17, 2022

Coverage Status

Coverage increased (+0.05%) to 74.518% when pulling 27119e7 on OpenSourceProjects:auto-update-docs into 9f5fad1 on 99designs:master.

docs/build.sh Outdated
'v0.9.3'
'v0.8.3'
)
IFS=$'\n' read -r -d '' -a VERSIONS_ARRAY < <(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/99designs/gqlgen/releases?per_page=20" | jq -r '.[].tag_name')
Copy link
Contributor Author

@frankywahl frankywahl Apr 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of things to note:

  1. This limits to the last 20 versions. I think it's probably enough. We could have more, but those versions risk being very old.
  2. This assumes jq & curl has been installed on the machine running this script. I suspect that is the case though I am not sure how render.com works
  3. This will also change the position of master to being at the bottom of the list all the time.
  4. This acts as an un-authenticated CURL request. We can actually authenticate it too with some config vars to avoid the 60/hour rate limit.

docs/build.sh Outdated
@@ -3,25 +3,13 @@
# This was adapted from https://github.com/dgraph-io/dgraph/blob/master/wiki/scripts/build.sh
#

set -e
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, this would not work if I left it in. Don't think it's a huge issue

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-e When this option is on, if a simple command fails for any of the reasons listed in Consequences of
Shell Errors or returns an exit status value >0, and is not part of the compound list following a
while, until, or if keyword, and is not a part of an AND or OR list, and is not a pipeline
preceded by the ! reserved word, then the shell shall immediately exit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - I understand that - I'm just unsure what the error is because I don't get an output. I'll put it a commit that reinstates it. It may help clarify

@StevenACoffman StevenACoffman merged commit a153892 into 99designs:master Apr 17, 2022
@StevenACoffman
Copy link
Collaborator

This will be great. I'm going to merge this as is, but if it fails on master, then I'll look into changing it to set -ex to and add some printf message to see what's going on.

telemenar pushed a commit to observeinc/gqlgen that referenced this pull request Apr 18, 2022
* Use Github API to update the docs

Instead of a hard-coded version of the docs we want to realease, this
uses the Github API to get the last 20 versions and publish those. This
will allow any script invoking this to make sure to always have the
latest version of the docs

* Reinstate set -e
telemenar pushed a commit to observeinc/gqlgen that referenced this pull request Apr 18, 2022
* Use Github API to update the docs

Instead of a hard-coded version of the docs we want to realease, this
uses the Github API to get the last 20 versions and publish those. This
will allow any script invoking this to make sure to always have the
latest version of the docs

* Reinstate set -e
@frankywahl frankywahl deleted the auto-update-docs branch April 21, 2022 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants