forked from microcks/microcks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prep-next-iteration.sh
executable file
·42 lines (39 loc) · 2.68 KB
/
prep-next-iteration.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
#
# Copyright The Microcks 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.
#
root_dir=$(pwd)
# Need 2 arguments: first is version we just release, second is container tag for next iteration.
if [[ $# -eq 2 ]]; then
# Update container image version in docker-compose, podman-compose and helm chart files.
if [ "$(uname)" == "Darwin" ]; then
sed -i '' 's=quay.io/microcks/microcks:'"$1"'=quay.io/microcks/microcks:'"$2"'=g' install/docker-compose/docker-compose*.yml
sed -i '' 's=quay.io/microcks/microcks-async-minion:'"$1"'=quay.io/microcks/microcks-async-minion:'"$2"'=g' install/docker-compose/docker-compose*.yml
sed -i '' 's=quay.io/microcks/microcks:'"$1"'=quay.io/microcks/microcks:'"$2"'=g' install/kubernetes/microcks/values.yaml
sed -i '' 's=quay.io/microcks/microcks-async-minion:'"$1"'=quay.io/microcks/microcks-async-minion:'"$2"'=g' install/kubernetes/microcks/values.yaml
sed -i '' 's=quay.io/microcks/microcks:'"$1"'=quay.io/microcks/microcks:'"$2"'=g' install/podman-compose/microcks-*.yml
sed -i '' 's=quay.io/microcks/microcks-async-minion:'"$1"'=quay.io/microcks/microcks-async-minion:'"$2"'=g' install/podman-compose/microcks-*.yml
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
sed -i 's=quay.io/microcks/microcks:'"$1"'=quay.io/microcks/microcks:'"$2"'=g' install/docker-compose/docker-compose.yml
sed -i 's=quay.io/microcks/microcks-async-minion:'"$1"'=quay.io/microcks/microcks-async-minion:'"$2"'=g' install/docker-compose/docker-compose*.yml
sed -i 's=quay.io/microcks/microcks:'"$1"'=quay.io/microcks/microcks:'"$2"'=g' install/kubernetes/microcks/values.yaml
sed -i 's=quay.io/microcks/microcks-async-minion:'"$1"'=quay.io/microcks/microcks-async-minion:'"$2"'=g' install/kubernetes/microcks/values.yaml
sed -i 's=quay.io/microcks/microcks:'"$1"'=quay.io/microcks/microcks:'"$2"'=g' install/podman-compose/microcks-*.yml
sed -i 's=quay.io/microcks/microcks-async-minion:'"$1"'=quay.io/microcks/microcks-async-minion:'"$2"'=g' install/podman-compose/microcks-*.yml
fi
else
echo "prep-next-iteration.sh must be called with <version> <next-container-tag> as 1st argument. Example:"
echo "$ ./prep-next-iteration.sh 1.7.1 nightly"
fi