@@ -22,27 +22,32 @@ phases:
2222 build :
2323 commands :
2424 - VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);")
25- # get extension name
25+ # get extension name, if in beta, use some hard-coded recent version
2626 - |
2727 if [ "${TARGET_EXTENSION}" = "amazonq" ]; then
2828 extension_name="amazonwebservices.amazon-q-vscode"
29+ [ "$STAGE" != "prod" ] && VERSION="1.43.0" || true
2930 elif [ "${TARGET_EXTENSION}" = "toolkit" ]; then
3031 extension_name="amazonwebservices.aws-toolkit-vscode"
32+ [ "$STAGE" != "prod" ] && VERSION="3.42.0" || true
3133 else
3234 echo checkmarketplace: "Unknown TARGET_EXTENSION: ${TARGET_EXTENSION}"
3335 exit 1
3436 fi
35- # keep reinstalling the extension until the desired version is updated. Otherwise fail on codebuild timeout (1 hour).
37+ if [ "$STAGE" != "prod" ]; then
38+ echo "checkmarketplace: Non-production stage detected. Installing hardcoded version '${VERSION}'."
39+ fi
40+ # keep installing the desired extension version until successful. Otherwise fail on codebuild timeout (1 hour).
3641 - |
3742 while true; do
3843 code --uninstall-extension "${extension_name}" --no-sandbox --user-data-dir /tmp/vscode
39- code --install-extension ${extension_name} --no-sandbox --user-data-dir /tmp/vscode
44+ code --install-extension " ${extension_name}@${VERSION}" --no-sandbox --user-data-dir /tmp/vscode || true
4045 cur_version=$(code --list-extensions --show-versions --no-sandbox --user-data-dir /tmp/vscode | grep ${extension_name} | cut -d'@' -f2)
4146 if [ "${cur_version}" = "${VERSION}" ]; then
4247 echo "checkmarketplace: Extension ${extension_name} is updated to version '${cur_version}.'"
4348 break
4449 else
45- echo "checkmarketplace: Current version '${cur_version }' does not match expected version '${VERSION}' . Retrying..."
50+ echo "checkmarketplace: Expected extension version '${VERSION }' has not been successfully installed . Retrying..."
4651 fi
4752 sleep 120 # Wait for 2 minutes before retrying
4853 done
0 commit comments