File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
buildspec/release/buildspec/release Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ version : 0.2
2
+
3
+ phases :
4
+ install :
5
+ runtime-versions :
6
+ nodejs : 16
7
+
8
+ commands :
9
+ - apt update
10
+ - apt install -y wget gpg
11
+ - curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
12
+ - install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
13
+ - sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
14
+ - apt update
15
+ - apt install -y code
16
+
17
+ pre_build :
18
+ commands :
19
+ # Check for implicit env vars passed from the release pipeline.
20
+ - test -n "${TARGET_EXTENSION}"
21
+
22
+ build :
23
+ commands :
24
+ - VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);")
25
+ # get extension name
26
+ - |
27
+ if [ "${TARGET_EXTENSION}" = "amazonq" ]; then
28
+ extension_name="amazonwebservices.amazon-q-vscode"
29
+ elif [ "${TARGET_EXTENSION}" = "toolkit" ]; then
30
+ extension_name="amazonwebservices.aws-toolkit-vscode"
31
+ else
32
+ echo "Unknown TARGET_EXTENSION: ${TARGET_EXTENSION}"
33
+ exit 1
34
+ fi
35
+ # keep reinstalling the extension until the desired version is updated. Otherwise fail on codebuild timeout (1 hour).
36
+ - |
37
+ while true; do
38
+ 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
40
+ cur_version=$(code --list-extensions --show-versions --no-sandbox --user-data-dir /tmp/vscode | grep ${extension_name} | cut -d'@' -f2)
41
+ if [ "${cur_version}" = "${VERSION}" ]; then
42
+ echo "checkmarketplace: Extension ${extension_name} is updated to version '${cur_version}.'"
43
+ break
44
+ else
45
+ echo "checkmarketplace: Current version '${cur_version}' does not match expected version '${VERSION}'. Retrying..."
46
+ fi
47
+ sleep 120 # Wait for 2 minutes before retrying
48
+ done
You can’t perform that action at this time.
0 commit comments