Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for arm-upgrade for existing users #15

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions scripts/shell/upgrade-devtron-v6.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Check if $RELEASE_NAME is set if not, then set default to devtron
if [ -z $RELEASE_NAME ]
then
RELEASE_NAME=devtron
fi
current_version=$(helm ls -n devtroncd -f $RELEASE_NAME -o json | grep -Po '"chart":.*?[^\\]"' | awk -F'["]' '{print $4}' | awk -F'[-]' '{print $3}')
# If current version not found, abort upgrade
if [ -z $current_version ]
then
echo "Current Version not found - Aborting Upgrade please contact us on https://discord.devtron.ai"
exit 1
fi
is_legacy=$(echo "$current_version 0.22.35" | awk '{print ($1 < $2)}')
kubectl get deploy inception -n devtroncd
if [ $(echo $?) -eq 1 ]
then
Expand All @@ -6,7 +19,12 @@ kubectl create ns argo
kubectl create ns devtron-ci
kubectl create ns devtron-cd
helm repo update
if [ $is_legacy -eq 1 ]
then
helm upgrade $RELEASE_NAME devtron/devtron-operator -n devtroncd -f https://raw.githubusercontent.com/devtron-labs/devtron/main/charts/devtron/values.yaml --reuse-values --set installer.arch="legacy"
else
helm upgrade $RELEASE_NAME devtron/devtron-operator -n devtroncd -f https://raw.githubusercontent.com/devtron-labs/devtron/main/charts/devtron/values.yaml --reuse-values
fi
else
echo "Found Devtron with CICD - Upgrading to latest version. Please ignore any errors you observe during upgrade"
sleep 3
Expand Down Expand Up @@ -135,9 +153,19 @@ then
echo "Found Blob Storage Provider as Minio"
minioAccessKey=$(kubectl -n devtroncd get secret devtron-minio -o jsonpath='{.data.accesskey}' | base64 -d)
minioSecretKey=$(kubectl -n devtroncd get secret devtron-minio -o jsonpath='{.data.secretkey}' | base64 -d)
if [ $is_legacy -eq 1 ]
then
helm upgrade $RELEASE_NAME devtron/devtron-operator -n devtroncd -f https://raw.githubusercontent.com/devtron-labs/devtron/main/charts/devtron/values.yaml --reuse-values --set configs.BLOB_STORAGE_PROVIDER="S3" --set configs.BLOB_STORAGE_S3_ENDPOINT="http://devtron-minio.devtroncd:9000" --set-string configs.BLOB_STORAGE_S3_ENDPOINT_INSECURE="true" --set secrets.BLOB_STORAGE_S3_ACCESS_KEY=$minioAccessKey --set secrets.BLOB_STORAGE_S3_SECRET_KEY=$minioSecretKey --set configs.DEFAULT_BUILD_LOGS_BUCKET="devtron-ci-log" --set configs.DEFAULT_CACHE_BUCKET="devtron-ci-cache" --set installer.modules={cicd} --set argo-cd.enabled=true --set security.enabled=true --set security.clair.enabled=true --set monitoring.grafana.enabled=true --set notifier.enabled=true --set installer.arch="legacy"
else
helm upgrade $RELEASE_NAME devtron/devtron-operator -n devtroncd -f https://raw.githubusercontent.com/devtron-labs/devtron/main/charts/devtron/values.yaml --reuse-values --set configs.BLOB_STORAGE_PROVIDER="S3" --set configs.BLOB_STORAGE_S3_ENDPOINT="http://devtron-minio.devtroncd:9000" --set-string configs.BLOB_STORAGE_S3_ENDPOINT_INSECURE="true" --set secrets.BLOB_STORAGE_S3_ACCESS_KEY=$minioAccessKey --set secrets.BLOB_STORAGE_S3_SECRET_KEY=$minioSecretKey --set configs.DEFAULT_BUILD_LOGS_BUCKET="devtron-ci-log" --set configs.DEFAULT_CACHE_BUCKET="devtron-ci-cache" --set installer.modules={cicd} --set argo-cd.enabled=true --set security.enabled=true --set security.clair.enabled=true --set monitoring.grafana.enabled=true --set notifier.enabled=true
fi
else
echo "Blob Storage Provider - $provider"
if [ $is_legacy -eq 1 ]
then
helm upgrade $RELEASE_NAME devtron/devtron-operator -n devtroncd -f https://raw.githubusercontent.com/devtron-labs/devtron/main/charts/devtron/values.yaml --reuse-values --set installer.modules={cicd} --set configs.BLOB_STORAGE_PROVIDER=$provider --set argo-cd.enabled=true --set security.enabled=true --set security.clair.enabled=true --set monitoring.grafana.enabled=true --set notifier.enabled=true --set installer.arch="legacy"
else
helm upgrade $RELEASE_NAME devtron/devtron-operator -n devtroncd -f https://raw.githubusercontent.com/devtron-labs/devtron/main/charts/devtron/values.yaml --reuse-values --set installer.modules={cicd} --set configs.BLOB_STORAGE_PROVIDER=$provider --set argo-cd.enabled=true --set security.enabled=true --set security.clair.enabled=true --set monitoring.grafana.enabled=true --set notifier.enabled=true
fi
fi
fi