Skip to content

Commit b52e26b

Browse files
committed
Simplify and add debug logic for log copy
1 parent f6acc8e commit b52e26b

File tree

1 file changed

+21
-38
lines changed

1 file changed

+21
-38
lines changed

.vsts.pipelines/jobs/ci-linux.yml

Lines changed: 21 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,24 @@ jobs:
8181
/p:ProdConBlobFeedUrlPrefix=$(prodConBlobFeedUrlPrefix)
8282
displayName: Run smoke-test
8383
84-
# Copy source-buid logs
84+
# Copy source-build logs
8585
- script: |
8686
set -x
87+
logDir=/logs/source-build/logs
8788
$(docker.run) $(docker.logs.map) $(docker.src.map) $(docker.src.work) $(imageName) /bin/bash -c "
88-
mkdir -p /logs/source-build/logs
89-
find \"\$PWD\" \( \
89+
mkdir -p $logDir
90+
find \"\$PWD\" \
91+
-depth \
92+
\( \
9093
-path './bin/*-report/*' -o \
9194
-path './bin/msbuild-debug/*' -o \
9295
-iname '*.binlog' -o \
93-
-iname '*.log' \) \
94-
-exec cp {} --parents /logs/source-build/logs \;"
95-
displayName: Copy source-build logs
96-
condition: always()
97-
continueOnError: true
98-
99-
# Delete local copy of source-build logs
100-
- script: |
101-
set -x
102-
$(docker.run) $(docker.src.map) $(docker.src.work) $(imageName) /bin/bash -c "
103-
find \"\$PWD\" \( \
104-
-path './bin/*-report/*' -o \
105-
-path './bin/msbuild-debug/*' -o \
106-
-iname '*.binlog' -o \
107-
-iname '*.log' \) \
96+
-iname '*.log' \
97+
\) \
98+
-exec echo Copying and removing {} \; \
99+
-exec cp {} --parents $logDir \; \
108100
-exec rm -rf {} \;"
109-
displayName: Remove source-build logs
101+
displayName: Copy source-build logs
110102
condition: always()
111103
continueOnError: true
112104
@@ -187,31 +179,22 @@ jobs:
187179
# Copy tarball logs and reports to staging directory.
188180
- script: |
189181
set -x
182+
logDir=/logs/tarball/logs
190183
$(docker.run) $(docker.logs.map) $(docker.tb.map) $(docker.tb.work) $(imageName) /bin/bash -c "
191-
mkdir -p /logs/tarball/logs
184+
mkdir -p $logDir
192185
cd \"$(tarballName)\"
193-
find \"\$PWD\" \( \
186+
find \"\$PWD\" \
187+
-depth \
188+
\( \
194189
-path './bin/*-report/*' -o \
195190
-path './bin/msbuild-debug/*' -o \
196191
-iname '*.binlog' -o \
197-
-iname '*.log' \) \
198-
-exec cp {} --parents /logs/tarball/logs \;"
199-
displayName: Copy tarball logs
200-
condition: eq(variables['sb.tarball'], true)
201-
continueOnError: true
202-
203-
# Remove tarball logs and reports
204-
- script: |
205-
set -x
206-
$(docker.run) $(docker.tb.map) $(docker.tb.work) $(imageName) /bin/bash -c "
207-
cd \"$(tarballName)\"
208-
find \"\$PWD\" \( \
209-
-path './bin/*-report/*' -o \
210-
-path './bin/msbuild-debug/*' -o \
211-
-iname '*.binlog' -o \
212-
-iname '*.log' \) \
192+
-iname '*.log' \
193+
\) \
194+
-exec echo Copying and removing {} \; \
195+
-exec cp {} --parents $logDir \; \
213196
-exec rm -rf {} \;"
214-
displayName: Remove tarball logs
197+
displayName: Copy tarball logs
215198
condition: eq(variables['sb.tarball'], true)
216199
continueOnError: true
217200

0 commit comments

Comments
 (0)