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 ##############################################################################
12 update_file_usage () {
13 echo "Usage: $0 <path_to_autorelease> <release_name> <branch_name> <publish>"
15 echo " path_to_autorelease: The path to the autorelease"
16 echo " release_name: The release_name e.g Magnesium ."
17 echo " branch_name: Name of the branch to be updated e.g stable/sodium."
18 echo " publish: Set to true to publish"
21 while getopts :h: opts; do
35 path_to_autorelease="$1"
37 # Captilize Version Name
38 release_name="$(tr '[:lower:]' '[:upper:]' <<< "${release_name:0:1}")${release_name:1}"
45 cd "$path_to_autorelease"/ || exit
48 #'|| true' for repo like serviceutils where docs/conf.yaml doesn't exist
49 command='sed -i ''"s/.*version.*/version: '"$release_name"'/"'' docs/conf.yaml || true'
50 git submodule foreach "git checkout $branch_name"
51 git submodule foreach "$command"
52 if [ "$publish" == "true" ]
54 git submodule foreach "git add . || true"
55 git submodule foreach "git commit -s -m 'Update docs header to $release_name in $branch_name
57 Should be $release_name on $branch_name.' || true"
58 git submodule foreach "git review || true"