@@ -22,27 +22,32 @@ phases:
22
22
build :
23
23
commands :
24
24
- 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
26
26
- |
27
27
if [ "${TARGET_EXTENSION}" = "amazonq" ]; then
28
28
extension_name="amazonwebservices.amazon-q-vscode"
29
+ [ "$STAGE" != "prod" ] && VERSION="1.43.0" || true
29
30
elif [ "${TARGET_EXTENSION}" = "toolkit" ]; then
30
31
extension_name="amazonwebservices.aws-toolkit-vscode"
32
+ [ "$STAGE" != "prod" ] && VERSION="3.42.0" || true
31
33
else
32
34
echo checkmarketplace: "Unknown TARGET_EXTENSION: ${TARGET_EXTENSION}"
33
35
exit 1
34
36
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).
36
41
- |
37
42
while true; do
38
43
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
40
45
cur_version=$(code --list-extensions --show-versions --no-sandbox --user-data-dir /tmp/vscode | grep ${extension_name} | cut -d'@' -f2)
41
46
if [ "${cur_version}" = "${VERSION}" ]; then
42
47
echo "checkmarketplace: Extension ${extension_name} is updated to version '${cur_version}.'"
43
48
break
44
49
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..."
46
51
fi
47
52
sleep 120 # Wait for 2 minutes before retrying
48
53
done
0 commit comments