From: Thanh Ha Date: Tue, 11 Aug 2020 23:07:07 +0000 (-0400) Subject: Remove docs branching scripts X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=03d76a5eac169cbb5c4b7ad6a152b5849d96823a;p=docs.git Remove docs branching scripts Functionality of these scripts have been moved to releng/builder under the autorelease project via I0aa6838d1fd4e2df536a4e30fb8751b7d3a466bf to be handled as part of branch cutting activities for managed projects. There's the script docs_master_branch_update.sh needs to be rewritten as it does not work for our purposes and in it's current state is quite broken. We'll handle this as a separate task but removing here as this script is not in use in production today. Issue: DOCS-129 Signed-off-by: Thanh Ha Change-Id: If3f9b61636643c065ef11aa048debeb92422628e (cherry picked from commit 1c4a0997001232c6010b5acc22a74ed9f9d6c2a0) --- diff --git a/docs_master_branch_update.sh b/docs_master_branch_update.sh deleted file mode 100644 index 029df9444..000000000 --- a/docs_master_branch_update.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2019 The Linux Foundation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################## - -update_file_usage () { - echo "Usage: $0 " - echo "" - echo " next_release_name: The next_release_name e.g Magnesium ." - echo " release_name: Name of the current release_name e.g sodium." - echo " publish: Set to true to publish" - echo "" -} -while getopts :h: opts; do - case "$opts" in - h) - update_file_usage - exit 0 - ;; - [?]) - update_file_usage - exit 1 - ;; - esac -done - -# User input -next_release_name="$1" -Next_release="$(tr '[:lower:]' '[:upper:]' <<< "${next_release_name:0:1}")${next_release_name:1}" # Captilize Version Name -release_name="$2" -Release_version="$(tr '[:lower:]' '[:upper:]' <<< "${release_name:0:1}")${release_name:1}" # Captilize Version Name -release_branch=stable/"$2" -publish="$3" -stable_release_str=stable-$release_name - -#################################### -# Changes in the new stable branch # -#################################### -git checkout "$release_branch" - -#Updating links in docs/conf.py -sed -i "s/latest/$stable_release_str/g" docs/conf.py -if [ "$publish" == "true" ] -then - git add docs/conf.py - git commit -s -m "Update docs/conf.py links from latest to $stable_release_str - Should be $stable_release_str on $release_branch." - git review -fi - -#################################### -# Changes in the master branch # -#################################### -git checkout master -odl_release_str=odl-$release_name -next_odl_release_str=odl-$next_release_name -#change the odl- linking to stable- to odl- linking to latest -sed -i "s/$odl_release_str/$next_odl_release_str/g;" docs/conf.py -sed -i "s/$stable_release_str/latest/g;" docs/conf.py - -# Get the value of line with odl- linking to stable- -# for appending it to the line next to odl- linking to latest -line_number_nr=$(sed -n "/$next_odl_release_str/=" docs/conf.py) -pattern=$line_number_nr"p" -odl_latest="sed -n $pattern docs/conf.py" -odl_latest_line_value=$($odl_latest) -append_odl_latest=$(echo "$odl_latest_line_value" | sed "s/latest/$stable_release_str/g; s/$next_release_name/$release_name/g" ) - -# Update docs/conf.py -# sed -i "$line_number_nr'i'\ -# $append_odl_latest" docs/conf.py -sed -i "$line_number_nr a $append_odl_latest" docs/conf.py -# Updating version in docs/conf.yaml -sed -i "s/$Release_version/$Next_release/g" docs/conf.yaml -# Updating version in docs/javadoc.rst -sed -i "s/$release_name/$next_release_name/g" docs/javadoc.rst -if [ "$publish" == "true" ] -then - git add docs/conf.py docs/conf.yaml docs/javadoc.rst - git commit -s -m "Update configuratiom files in master branch - - In docs/conf.py , add odl-$next_release_name pointing to latest - and change odl-$release_name to point to stable-$release_name. - In docs/conf.yaml - Change version from $Release_version to $Next_release. - In docs/javadoc.rst - Change links from $release_name to $next_release_name" - git review -fi diff --git a/update_docs_version.sh b/update_docs_version.sh deleted file mode 100644 index dbfd1d983..000000000 --- a/update_docs_version.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2019 The Linux Foundation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################## - -update_file_usage () { - echo "Usage: $0 " - echo "" - echo " path_to_autorelease: The path to the autorelease" - echo " release_name: The release_name e.g Magnesium ." - echo " branch_name: Name of the branch to be updated e.g stable/sodium." - echo " publish: Set to true to publish" - echo "" -} -while getopts :h: opts; do - case "$opts" in - h) - update_file_usage - exit 0 - ;; - [?]) - update_file_usage - exit 1 - ;; - esac -done - -# User input -path_to_autorelease="$1" -release_name="$2" -# Captilize Version Name -release_name="$(tr '[:lower:]' '[:upper:]' <<< "${release_name:0:1}")${release_name:1}" -branch_name="$3" -publish="$4" - -################ -# Start script # -############### -cd "$path_to_autorelease"/ || exit -git submodule update - -#'|| true' for repo like serviceutils where docs/conf.yaml doesn't exist -command='sed -i ''"s/.*version.*/version: '"$release_name"'/"'' docs/conf.yaml || true' -git submodule foreach "git checkout $branch_name" -git submodule foreach "$command" -if [ "$publish" == "true" ] - then - git submodule foreach "git add . || true" - git submodule foreach "git commit -s -m 'Update docs header to $release_name in $branch_name - -Should be $release_name on $branch_name.' || true" - git submodule foreach "git review || true" -fi