Skip to content

Commit 702da58

Browse files
committed
Switch back to the script.
1 parent 807082b commit 702da58

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

Build/cg/cg.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,27 @@ extends:
9898
- script: mkdir $(Build.ArtifactStagingDirectory)\Extension
9999
displayName: Create Extension Staging Directory
100100

101-
- task: Bash@3
102-
displayName: Build files
103-
inputs:
104-
targetType: 'inline'
105-
script: |
106-
cd $(Build.SourcesDirectory)/Extension
101+
- bash: |
102+
TRY_COUNT=3
103+
EXIT_CODE=1
104+
for attempt in $(seq 1 $TRY_COUNT); do
107105
yarn run vsix-prepublish
108-
retryCountOnTaskFailure: 3
106+
EXIT_CODE=$?
107+
if [ $EXIT_CODE -eq 0 ]; then
108+
break
109+
fi
110+
if [ $attempt -lt $TRY_COUNT ]; then
111+
echo "Attempt $attempt/$TRY_COUNT failed, retrying in 30s..."
112+
sleep 30
113+
fi
114+
done
115+
# Check if the last command succeeded
116+
if [ $EXIT_CODE -ne 0 ]; then
117+
echo "vsix-prepublish failed after $TRY_COUNT attempts."
118+
exit 1
119+
fi
120+
displayName: Build files
121+
workingDirectory: $(Build.SourcesDirectory)\Extension
109122
110123
- script: |
111124
cd $(Build.SourcesDirectory)\Extension

0 commit comments

Comments
 (0)