| David Garcia | 3ca9613 | 2021-11-18 16:45:05 +0100 | [diff] [blame] | 1 | ## |
| 2 | # Copyright 2019 ETSI |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | # not use this file except in compliance with the License. You may obtain |
| 6 | # a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | # License for the specific language governing permissions and limitations |
| 14 | # under the License. |
| 15 | ## |
| 16 | |
| 17 | charms=`cat bundles/osm/bundle.yaml | grep cs | grep -v k8s | awk '{print $2}' | tr -d \"` |
| 18 | for charm_uri in $charms; do |
| 19 | charm_without_rev=`echo $charm_uri| rev | cut -d "-" -f 2-5 | rev` |
| 20 | latest_revision=`charm show --channel edge $charm_without_rev | grep Revision | awk '{print $2}'` |
| 21 | new_charm_uri=$charm_without_rev-$latest_revision |
| 22 | old_uri=`echo $charm_uri | sed 's/\//\\\\\//g'` |
| 23 | new_uri=`echo $new_charm_uri | sed 's/\//\\\\\//g'` |
| 24 | sed -i "s/"$old_uri"/"$new_uri"/g" bundles/osm/bundle.yaml |
| 25 | done |
| 26 | |
| 27 | charms=`cat bundles/osm-ha/bundle.yaml | grep cs | grep -v k8s | awk '{print $2}' | tr -d \"` |
| 28 | for charm_uri in $charms; do |
| 29 | charm_without_rev=`echo $charm_uri| rev | cut -d "-" -f 2-5 | rev` |
| 30 | latest_revision=`charm show --channel edge $charm_without_rev | grep Revision | awk '{print $2}'` |
| 31 | new_charm_uri=$charm_without_rev-$latest_revision |
| 32 | old_uri=`echo $charm_uri | sed 's/\//\\\\\//g'` |
| 33 | new_uri=`echo $new_charm_uri | sed 's/\//\\\\\//g'` |
| 34 | sed -i "s/"$old_uri"/"$new_uri"/g" bundles/osm-ha/bundle.yaml |
| 35 | done |