Mohammed Naser | e04accd | 2023-01-15 20:07:27 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Copyright (c) 2023 VEXXHOST, Inc. |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | # not use this file except in compliance with the License. You may obtain |
| 7 | # a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | # License for the specific language governing permissions and limitations |
| 15 | # under the License. |
| 16 | |
| 17 | # This script is used to sync the charts from the upstream repositories into |
| 18 | # the charts directory. It is used to update the charts to the versions which |
| 19 | # are defined in this file. |
| 20 | |
| 21 | set -xe |
| 22 | |
| 23 | # Determine the root path for Atmosphere |
| 24 | ATMOSPHERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )" |
| 25 | |
| 26 | # Create work directory to avoid cluttering up workspace |
| 27 | WORKDIR=$(mktemp -d) |
| 28 | function cleanup { |
| 29 | rm -rfv ${WORKDIR} |
| 30 | } |
| 31 | trap cleanup EXIT |
| 32 | |
| 33 | # Clean-up all of the existing charts |
| 34 | rm -rfv ${ATMOSPHERE}/charts/* |
| 35 | |
| 36 | # Switch to folder where we will be syncing charts |
| 37 | pushd ${WORKDIR} |
| 38 | |
| 39 | PERCONA_REF="25d8099e1e1f807b6bc90d8d92b6a31a6dff082b" |
| 40 | curl -LO https://github.com/percona/percona-helm-charts/archive/${PERCONA_REF}.tar.gz |
| 41 | tar --strip-components=2 -C ${ATMOSPHERE}/charts -xvzf ${PERCONA_REF}.tar.gz percona-helm-charts-${PERCONA_REF}/charts/pxc-operator |
| 42 | |
| 43 | # Switch back to original directory |
| 44 | popd |