Skip to content

Commit b13c551

Browse files
authored
Upload to ign-gazebo docs to both api/gazebo and api/sim (#436)
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>
1 parent fa5a40c commit b13c551

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tools/scripts/build_gz.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ if [[ ! -z "$4" && "$4" != "n" ]]; then
4242
libName=`echo "$2" | grep -oP "(?<=gz-).*"`
4343
libName="${libName//-/_}"
4444

45+
majorVersion="${version/\.*/}"
46+
# Make sure the majorVersion is a valid number
47+
numberCheckRegex='^[0-9]+$'
48+
if [[ $majorVersion =~ $numberCheckRegex ]]; then
49+
# If this is ign-gazebo (gz-sim <= 6), the upload_doc.sh will upload to api/gazebo so we'll need to
50+
# sync to api/sim manually
51+
if [[ "$libName" == "sim" && "$majorVersion" -le 6 ]]; then
52+
aws s3 sync s3://gazebosim.org/api/gazebo/${majorVersion}/ s3://gazebosim.org/api/sim/${majorVersion}/
53+
fi
54+
else
55+
echo "Invalid major version ${majorVersion}"
56+
fi
57+
4558
echo -e "\e[46m\e[30mAdding version [$version] for library [$libName], release date [$5]...\e[0m\e[39m"
4659
curl -k -X POST -d '{"libName":"'"$libName"'", "version":"'"$version"'", "releaseDate":"'"$5"'","password":"'"$6"'"}' https://api.gazebosim.org/1.0/versions
4760
echo -e "\e[46m\e[30mAdded version [$version] for library [$libName], release date [$5]\e[0m\e[39m"

0 commit comments

Comments
 (0)