Skip to content

Commit

Permalink
Add script to bump versions. (#256)
Browse files Browse the repository at this point in the history
* Add script to bump versions.

* Include docker directory in search
  • Loading branch information
tdmanv committed Sep 3, 2019
1 parent 85e794a commit ada0771
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions build/bump_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Copyright 2019 The Kanister Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail
set -o xtrace


usage() {
echo ./build/bump_version.sh previous_version release_version
exit 1
}

main() {
local prev=${1:?"$(usage)"}
local next=${2:?"$(usage)"}
local -a pkgs=(docker/ scripts/ examples/ pkg/ helm/ docs/)
grep -E "${prev}" -r "${pkgs[@]}" | cut -d ':' -f 1 | uniq | xargs sed -ri "s/${prev}/${next//./\\.}/g"
}

main $@

0 comments on commit ada0771

Please sign in to comment.