Skip to content

Commit

Permalink
Add velaux upgrade script (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
chivalryq authored Apr 11, 2023
1 parent 6b5f971 commit e9e8998
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hack/upgrade_vela.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# This script is for upgrade kubevela helm charts maintained in velad repo
# Chart in this repo have one more argument(deployByPod) than that in kubevela repo.

# usage: ./hack/upgrade_vela.sh version_now version_upgrade_to
# e.g. ./hack/upgrade_vela.sh v1.3.3 v1.3.4
# usage: ./hack/upgrade_vela.sh version_upgrade_to
# e.g. ./hack/upgrade_vela.sh v1.3.4

set -e

Expand Down
39 changes: 39 additions & 0 deletions hack/upgrade_velaux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#! /bin/bash

# This script is for upgrade VelaUX

set -e

# If one parameter is passed, use it as the version to upgrade to.
# If two parameters are passed, use the second one as VelaUX image version. Sometimes, we skip the VelaUX image, only upgrade the VelaUX addon.

if [ $# = 1 ]; then
VERSION_TO=$1
IMAGE_VERSION=$1
elif [ $# = 2 ]; then
VERSION_TO=$1
IMAGE_VERSION=$2
else
echo "Usage: "$0" version_to [image_version]" >&2
exit 1
fi

VERION_TO=$1
IMAGE_VERSION=$2


VERSION_NOW=$(cat Makefile |grep "VELAUX_VERSION ?=" |grep -o "v.*")


PATCH_FILE_NAME=$VERSION_NOW-$VERSION_TO.patch
WORKDIR=pkg/resources/static/vela

echo "Upgrading VelaUX version From: "$VERSION_NOW" --> TO: "$VERSION_TO,
if [ -n "$IMAGE_VERSION" ]; then
echo "Upgrading VelaUX image version to: ""$IMAGE_VERSION"
else
echo "VelaUX image version is the same as VelaUX addon version"
fi

sed -i "" -e "s/VELAUX_VERSION ?= v.*/VELAUX_VERSION ?= $VERSION_TO/g" Makefile
sed -i "" -e "s/VELAUX_IMAGE_VERSION ?= .*/VELAUX_IMAGE_VERSION ?= $IMAGE_VERSION/g" Makefile

0 comments on commit e9e8998

Please sign in to comment.