removed version increment

This commit is contained in:
Gilles Mouchet 2025-02-07 21:06:57 +01:00
parent 6601d9d743
commit 5b41b636c1

View File

@ -87,35 +87,34 @@ fi
# increment minor version at each deploy # increment minor version at each deploy
# get Chart verion # get Chart verion
chart_version=$(grep appVersion helm/Chart.yaml | cut -d '"' -f2) #chart_version=$(grep appVersion helm/Chart.yaml | cut -d '"' -f2)
# get Chart major version # get Chart major version
chart_major_version=$(echo $chart_version | cut -d'.' -f1) #chart_major_version=$(echo $chart_version | cut -d'.' -f1)
# get Chart minor verison # get Chart minor verison
chart_minor_version=$(echo $chart_version | cut -d'.' -f2) #chart_minor_version=$(echo $chart_version | cut -d'.' -f2)
# increment minor version # increment minor version
let "chart_minor_version++" #let "chart_minor_version++"
# set new version # set new version
chart_new_version=$chart_major_version.$chart_minor_version #chart_new_version=$chart_major_version.$chart_minor_version
# replace in .env, .env.dist and Chart the version # replace in .env, .env.dist and Chart the version
env_file=(.env .env.dist ./docker/php-fpm/.env ./docker/php-fpm/.env.dist ./helm/Chart.yaml) #env_file=(.env .env.dist ./docker/php-fpm/.env ./docker/php-fpm/.env.dist ./helm/Chart.yaml)
for f in ${env_file[@]}; do #for f in ${env_file[@]}; do
case $f in # case $f in
.env|.env.dist) # .env|.env.dist)
#sed -e "s|DOCKER_IMAGE_VERSION=\"$chart_version\"|DOCKER_IMAGE_VERSION=\"$chart_new_version\"|" < $f # #sed -e "s|DOCKER_IMAGE_VERSION=\"$chart_version\"|DOCKER_IMAGE_VERSION=\"$chart_new_version\"|" < $f
sed -i "s|DOCKER_IMAGE_VERSION=\"$chart_version\"|DOCKER_IMAGE_VERSION=\"$chart_new_version\"|" $f # sed -i "s|DOCKER_IMAGE_VERSION=\"$chart_version\"|DOCKER_IMAGE_VERSION=\"$chart_new_version\"|" $f
;; # ;;
./docker/php-fpm/.env|./docker/php-fpm/.env.dist) # ./docker/php-fpm/.env|./docker/php-fpm/.env.dist)
#sed -e "s|SITE_VERSION=\"$chart_version\"|SITE_VERSION=\"$chart_new_version\"|" < $f # #sed -e "s|SITE_VERSION=\"$chart_version\"|SITE_VERSION=\"$chart_new_version\"|" < $f
sed -i "s|SITE_VERSION=\"$chart_version\"|SITE_VERSION=\"$chart_new_version\"|" $f # sed -i "s|SITE_VERSION=\"$chart_version\"|SITE_VERSION=\"$chart_new_version\"|" $f
;; # ;;
./helm/Chart.yaml) # ./helm/Chart.yaml)
#sed -e "s|appVersion: \"$chart_version\"|appVersion: \"$chart_new_version\"|" < $f # #sed -e "s|appVersion: \"$chart_version\"|appVersion: \"$chart_new_version\"|" < $f
sed -i "s|appVersion: \"$chart_version\"|appVersion: \"$chart_new_version\"|" $f # sed -i "s|appVersion: \"$chart_version\"|appVersion: \"$chart_new_version\"|" $f
;; # ;;
# esac
esac #done
done
echo $chart_version echo $chart_version
echo $chart_new_version echo $chart_new_version
@ -123,8 +122,8 @@ echo $ns
echo $kube_sys echo $kube_sys
# git commit # git commit
git add .env.dist docker/php-fpm/.env.dist helm/Chart.yaml #git add .env.dist docker/php-fpm/.env.dist helm/Chart.yaml
git commit -m "deploy version $chart_new_version" #git commit -m "deploy version $chart_new_version"
# build image and push in repo # build image and push in repo
./docker.sh install ./docker.sh install
@ -137,6 +136,6 @@ ln -s $HOME/.kube/$kube_sys $HOME/.kube/config
#helm template --set kube=$kube_sys ./helm --values=./helm/values-configs.yaml --values=./helm/values-secrets.yaml --namespace $ns --create-namespace #helm template --set kube=$kube_sys ./helm --values=./helm/values-configs.yaml --values=./helm/values-secrets.yaml --namespace $ns --create-namespace
# deploy Chart # deploy Chart
helm upgrade $ns --set kube=$kube_sys ./helm --install --atomic --cleanup-on-fail --values=./helm/values-configs.yaml --values=./helm/values-secrets.yaml --namespace $ns --create-namespace #helm upgrade $ns --set kube=$kube_sys ./helm --install --atomic --cleanup-on-fail --values=./helm/values-configs.yaml --values=./helm/values-secrets.yaml --namespace $ns --create-namespace
kubectl create job -n $NS --from=cronjob/cronjob-mariadb-backupdb dbbackup-$(date +%Y-%m-%d-%H-%M-%S) #kubectl create job -n $NS --from=cronjob/cronjob-mariadb-backupdb dbbackup-$(date +%Y-%m-%d-%H-%M-%S)