-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
[new] scripts/update-schema-latest.sh #3815
[new] scripts/update-schema-latest.sh #3815
Conversation
This script does the following. 1. Switch to the 'gh-pages' branch. 2. Copy "schemas/v{major}.{minor}/schema.json" in the 'main' branch to "oas/{major}.{minor}/schema/{YYYY-MM-DD}" in the 'gh-pages' branch. The value of {YYYY-MM-DD} is extracted from the '$id' property in the schema.json file. 3. Create a symbolic link "latest" under "oas/{major}.{minor}/schema" that points to the "{YYYY-MM-DD}" file. 4. Copy "schemas/v{major}.{minor}/schema-base.json" in the 'main' branch to "oas/{major}.{minor}/schema-base/{YYYY-MM-DD}" in the 'gh-pages' branch. The value of {YYYY-MM-DD} is extracted from the '$id' property in the schema-base.json file. 5. Create a symbolic link "latest" under "oas/{major}.{minor}/schema-base" that points to the "{YYYY-MM-DD}" file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work with -v 3.1
.
Fails for -v 3.0
with error
jq: error (at <stdin>:1666): split input and separator must be strings
Thanks for providing the script. The script works fine for the v3.1 case with separate Would you mind adding this distinction to the scripts? Thanks in advance! |
If it is necessary to support versions older than 3.0, please let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for both v3.1 and v3.0
# The command to update the 'latest' file. | ||
link_command="cd ${dst_dir} && ln -sf ${date} latest" | ||
|
||
# Execute the commands. | ||
__execute_command "${copy_command}" | ||
__execute_command "${link_command}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If #4034 is approved, this needs to become
# The command to update the 'latest' file. | |
link_command="cd ${dst_dir} && ln -sf ${date} latest" | |
# Execute the commands. | |
__execute_command "${copy_command}" | |
__execute_command "${link_command}" | |
# The commands to update the 'latest' file. | |
link_command="cd ${dst_dir} && ln -sf ${date} latest" | |
link_command2="cd ${dst_dir} && ln -sf ${date} latest.json" | |
# Execute the commands. | |
__execute_command "${copy_command}" | |
__execute_command "${link_command}" | |
__execute_command "${link_command2}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Steps 3 and 5 (symlink latest
) need to be replaced with
- rename
{YYYY-MM-DD}.md
to match the date of the new schema file
I'm closing this pull request since it's no longer needed since the recent changes to the schema publishing process. |
This script does the following.
Switch to the 'gh-pages' branch.
Copy "schemas/v{major}.{minor}/schema.json" in the 'main' branch to "oas/{major}.{minor}/schema/{YYYY-MM-DD}" in the 'gh-pages' branch. The value of {YYYY-MM-DD} is extracted from the '$id' property in the schema.json file.
Create a symbolic link "latest" under "oas/{major}.{minor}/schema" that points to the "{YYYY-MM-DD}" file.
Copy "schemas/v{major}.{minor}/schema-base.json" in the 'main' branch to "oas/{major}.{minor}/schema-base/{YYYY-MM-DD}" in the 'gh-pages' branch. The value of {YYYY-MM-DD} is extracted from the '$id' property in the schema-base.json file.
Create a symbolic link "latest" under "oas/{major}.{minor}/schema-base" that points to the "{YYYY-MM-DD}" file.