-
-
Notifications
You must be signed in to change notification settings - Fork 6
Add a script to populate the array of available versions (per project) #47
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,39 @@ | ||||||
#!/usr/bin/env -S bash -e | ||||||
|
||||||
PROJECT=$1 | ||||||
VERSION_FAMILY=$2 | ||||||
WORKSPACE=${WORKSPACE:-'.'} | ||||||
|
||||||
if [ -z "$PROJECT" ]; then | ||||||
echo "ERROR: Project not supplied" | ||||||
exit 1 | ||||||
fi | ||||||
if [ -z "$VERSION_FAMILY" ]; then | ||||||
echo "ERROR: Version family argument not supplied" | ||||||
exit 1 | ||||||
fi | ||||||
|
||||||
pushd ${WORKSPACE} | ||||||
|
||||||
wget -q http://docs.jboss.org/hibernate/_available-versions/${PROJECT}.json -O "available-${PROJECT}.json" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
? 🙈 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That being said, we can probably expose this -- and much more -- at There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rigth ... if we go with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, that's what I meant. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup, we just don't do it yet as for now all files come from the same server. but adding that cors in shouldn't be a problem, just need to keep in mind that orm is doing it not with these scripts 😃 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No rush, Marko. Maybe let's talk again before you do that? I'm sure you have plenty on your hands already :) |
||||||
if [ ! -s ${PROJECT}.json ]; then | ||||||
echo "Error downloading the ${PROJECT}.json descriptor. Exiting." | ||||||
exit 1 | ||||||
fi | ||||||
|
||||||
if jq -e "contains([\"$VERSION_FAMILY\"])" "available-${PROJECT}.json" >/dev/null; then | ||||||
echo "Version '$VERSION_FAMILY' already exists." | ||||||
else | ||||||
echo "Version '$VERSION_FAMILY' not found. Adding..." | ||||||
|
||||||
if jq ". + [\"$VERSION_FAMILY\"]" "available-${PROJECT}.json" > "available-${PROJECT}-updated.json"; then | ||||||
echo "Uploading updated file..." | ||||||
rsync -z --progress "available-${PROJECT}-updated.json" "filemgmt-prod-sync.jboss.org:/docs_htdocs/hibernate/_available-versions/${PROJECT}.json" | ||||||
rm -f "available-${PROJECT}-updated.json" | ||||||
else | ||||||
echo "Error: Failed to add available version '$VERSION_FAMILY'..." | ||||||
exit 1 | ||||||
fi | ||||||
fi | ||||||
|
||||||
popd |
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.
Are you sure this points to a directory that git-ignores
available-*.json
?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.
I just blindly copypasted the
upload-documentation.sh
where the outadeted json is updated 🙈