Skip to content

Commit c1fb42a

Browse files
committed
ci: extract dumping the environment into a script
1 parent 4f568f8 commit c1fb42a

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

src/ci/azure-pipelines/steps/run.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,8 @@ steps:
4848
- bash: python src/ci/cpu-usage-over-time.py &> cpu-usage.csv &
4949
displayName: "Collect CPU-usage statistics in the background"
5050

51-
- bash: printenv | sort
52-
displayName: Show environment variables
53-
54-
- bash: |
55-
set -e
56-
df -h
57-
du . | sort -nr | head -n100
58-
displayName: Show disk usage
59-
# FIXME: this hasn't been tested, but maybe it works on Windows? Should test!
60-
condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
51+
- bash: src/ci/scripts/dump-environment.sh
52+
displayName: Show the current environment
6153

6254
- template: install-sccache.yml
6355
- template: install-clang.yml

src/ci/scripts/dump-environment.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# This script dumps information about the build environment to stdout.
3+
4+
set -euo pipefail
5+
IFS=$'\n\t'
6+
7+
echo "environment variables:"
8+
printenv | sort
9+
echo
10+
11+
echo "disk usage:"
12+
df -h
13+
echo
14+
15+
echo "biggest files in the working dir:"
16+
set +o pipefail
17+
du . | sort -nr | head -n100
18+
set -o pipefail
19+
echo

0 commit comments

Comments
 (0)