From 0b4662b20e0ba46561221d6125d558ed01f65e09 Mon Sep 17 00:00:00 2001 From: Andrea Falzetti Date: Fri, 16 Dec 2022 11:21:00 +0000 Subject: [PATCH] [launcher] hot-deploy loops through all ides --- .../ide/jetbrains/launcher/hot-deploy.sh | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/components/ide/jetbrains/launcher/hot-deploy.sh b/components/ide/jetbrains/launcher/hot-deploy.sh index 600ccefdc190f1..85b9ec74271bde 100755 --- a/components/ide/jetbrains/launcher/hot-deploy.sh +++ b/components/ide/jetbrains/launcher/hot-deploy.sh @@ -19,24 +19,13 @@ dev_image="$(tar xfO "$bldfn" ./imgnames.txt | head -n1)" echo "Dev Image: $dev_image" cf_patch=$(kubectl get cm ide-config -o=json | jq '.data."config.json"' |jq -r) -# TODO: replace with for loop over .ideOptions.clients."jetbrains-gateway".desktopIDEs -# second image is always jb-launcher, if position is changed then this script should be updated as well -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.intellij.imageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.intellij.latestImageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.goland.imageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.goland.latestImageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.pycharm.imageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.pycharm.latestImageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.phpstorm.imageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.phpstorm.latestImageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.rubymine.imageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.rubymine.latestImageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.webstorm.imageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.webstorm.latestImageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.rider.imageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.rider.latestImageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.clion.imageLayers[1] = \"$dev_image\"") -cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.clion.latestImageLayers[1] = \"$dev_image\"") +ides=$(echo "$cf_patch" |jq '.ideOptions.clients."jetbrains-gateway".desktopIDEs') +for ide in $(echo "$ides" | jq -r '.[]'); do + # second image is always jb-launcher, if position is changed then this script should be updated as well + cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.${ide}.imageLayers[1] = \"$dev_image\"") + cf_patch=$(echo "$cf_patch" |jq ".ideOptions.options.${ide}.latestImageLayers[1] = \"$dev_image\"") +done + cf_patch=$(echo "$cf_patch" |jq tostring) cf_patch="{\"data\": {\"config.json\": $cf_patch}}"