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 <release_name> <PUBLISH>"
15 echo " release_name: The release_name e.g Magnesium ."
16 echo " PUBLISH: Set to true to PUBLISH"
19 while getopts :h: opts; do
31 set +u # Allow unbound variables for virtualenv
32 virtualenv --quiet "/tmp/v/git-review"
33 # shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091
34 source "/tmp/v/git-review/bin/activate"
35 pip install --quiet --upgrade "pip==9.0.3" setuptools
36 pip install --quiet --upgrade git-review
37 git config --global --add gitreview.username "jenkins-$SILO"
38 cd "$WORKSPACE"/autorelease || exit
39 GERRIT_PROJECT="releng/autorelease"
40 if [ "$GERRIT_PROJECT" == "releng/autorelease" ]; then
42 RELEASE_NAME=$RELEASE_NAME
43 # Captilize Version Name
44 release_name="$(tr '[:lower:]' '[:upper:]' <<< "${RELEASE_NAME:0:1}")${RELEASE_NAME:1}"
45 echo "Start Version Updating in odl-projects"
46 echo "RELEASE_NAME : $release_name"
51 #'|| true' for repo like serviceutils where docs/conf.yaml doesn't exist
52 command='sed -i ''"s/.*version.*/version: '"$release_name"'/"'' docs/conf.yaml || true'
53 git submodule foreach "git checkout $GERRIT_BRANCH"
54 echo "git checkout $GERRIT_BRANCH"
55 git submodule foreach "git branch"
56 git submodule foreach "$command"
57 if [ "$PUBLISH" == "true" ]
59 echo "Update docs header to $release_name in $STREAM"
60 git submodule foreach "git add . || true"
61 git submodule foreach "git commit -s -m 'Update docs header to $release_name in $STREAM
63 Should be $release_name on $STREAM.' || true"
64 git submodule foreach "git review || true"