- done
-
- if [[ "$rtdproject" != "$masterproject" ]]; then
- subproject_exists=false
- while read -r subproject; do
- if [[ "$subproject" == "$rtdproject" ]]; then
- subproject_exists=true
- break
- fi
- done < <(lftools rtd subproject-list "$masterproject")
-
- if $subproject_exists; then
- echo "INFO: subproject $rtdproject relationship already created"
- else
- echo "INFO: Creating subproject relationship"
- lftools rtd subproject-create "$masterproject" "$rtdproject"
- echo "INFO sleeping for 10 seconds"
- sleep 10
- fi
- fi
-
- # api v3 method does not update /latest/ when master is triggered.
- # Also, when we build anything other than master we want to trigger /stable/ as well.
- # allow projects to change their landing page from latest to branch_name
-
- current_version="$(lftools rtd project-details "$rtdproject" | yq -r .default_version)"
- if [[ -z ${DEFAULT_VERSION:-} ]]; then
- echo "DEFAULT_VERSION (default-version) value cannot be empty"
- exit 1
- fi
- default_version="${DEFAULT_VERSION}"
-
- echo "INFO: current default version $current_version"
- if [[ $current_version != "$default_version" ]]; then
- echo "INFO: Setting rtd landing page to $default_version"
- lftools rtd project-update "$rtdproject" default_version="$default_version"
- fi
-
- if [[ $GERRIT_BRANCH == "master" ]]; then
- echo "INFO: triggering $rtdproject latest"
- watchbuild latest
- else
-
- #read the docs only understands lower case branch names
- branch=$(echo "$GERRIT_BRANCH" | tr '[:upper:]' '[:lower:]')
- echo "INFO: Checking if read the docs has seen branch $branch"
-
- #if this is 404. then run discover branch
- if ! lftools rtd project-version-details "$rtdproject" "$branch" | jq '.active'; then
- echo "INFO: read the docs has not seen branch $branch for project $rtdproject"
- echo "INFO: triggering $rtdproject latest to instantiate new branch discovery"
- watchbuild latest
+ default_version="${DEFAULT_VERSION}"
+
+ echo "INFO: current default version $current_version"
+ if [[ $current_version != "$default_version" ]]; then
+ echo "INFO: Setting rtd landing page to $default_version"
+ lftools rtd project-update "$rtdproject" default_version="$default_version"