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}}"