Skip to content

Commit

Permalink
Upload to ign-gazebo docs to both api/gazebo and api/sim (#436)
Browse files Browse the repository at this point in the history
The upload_doc.sh script uploads to s3://gazebosim.org/api/gazebo/ when
building gz-sim versions lower than 6 (Fortress). However, our website
has links to https://gazebosim.org/api/sim/6/, which are currently
outdated (there must have been a manual upload at some point). This
fixes the problem by syncing the api/gazebo/${majorVersion} files into the api/sim/${majorVersion}
directory.

---------

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
  • Loading branch information
azeey authored Apr 25, 2024
1 parent fa5a40c commit b13c551
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/scripts/build_gz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ if [[ ! -z "$4" && "$4" != "n" ]]; then
libName=`echo "$2" | grep -oP "(?<=gz-).*"`
libName="${libName//-/_}"

majorVersion="${version/\.*/}"
# Make sure the majorVersion is a valid number
numberCheckRegex='^[0-9]+$'
if [[ $majorVersion =~ $numberCheckRegex ]]; then
# If this is ign-gazebo (gz-sim <= 6), the upload_doc.sh will upload to api/gazebo so we'll need to
# sync to api/sim manually
if [[ "$libName" == "sim" && "$majorVersion" -le 6 ]]; then
aws s3 sync s3://gazebosim.org/api/gazebo/${majorVersion}/ s3://gazebosim.org/api/sim/${majorVersion}/
fi
else
echo "Invalid major version ${majorVersion}"
fi

echo -e "\e[46m\e[30mAdding version [$version] for library [$libName], release date [$5]...\e[0m\e[39m"
curl -k -X POST -d '{"libName":"'"$libName"'", "version":"'"$version"'", "releaseDate":"'"$5"'","password":"'"$6"'"}' https://api.gazebosim.org/1.0/versions
echo -e "\e[46m\e[30mAdded version [$version] for library [$libName], release date [$5]\e[0m\e[39m"
Expand Down

0 comments on commit b13c551

Please sign in to comment.