2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2019 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
13 echo "Usage: $0 <token> <version_name>"
15 echo " token: RTD API Token"
16 echo " version_name: Name of the version to be activated e.g stable-aluminium."
20 # Activate project docs version in RTD
26 echo "Activating $project_name $version_name"
27 curl -X PATCH "https://readthedocs.org/api/v3/projects/$project_name/versions/$version_name/" \
28 -H "Authorization: Token $token" \
29 -H "Content-Type: application/json" \
30 --data "{\"active\": true, \"hidden\": false}"
33 # Build "latest" to force RTD to update available versions
34 update_available_versions() {
38 echo "Forcing RTD to update available versions"
39 curl -X POST "https://readthedocs.org/api/v3/projects/$project_name/versions/latest/builds/" \
40 -H "Authorization: Token $token" \
41 -H "Content-Length: 0"
44 while getopts :h: opts; do
74 opendaylight-distribution
80 opendaylight-serviceutils
83 for project in ${supported_projects[@]}; do
84 update_available_versions "$token" "$project" "$version_name"
89 echo "Waiting 60 seconds for available versions to update"
90 sleep 60 # Wait a minute for RTD to update available versions
92 for project in ${supported_projects[@]}; do
93 activate_version "$token" "$project" "$version_name"