@@ -4,33 +4,56 @@ functions:
4
4
type : setup
5
5
params :
6
6
binary : bash
7
- working_dir : mongoc
8
7
args :
9
8
- -c
10
- - .evergreen/scripts/abi-compliance-check-setup.sh
9
+ - |
10
+ if [[ -n "$XDG_CACHE_DIR" ]]; then
11
+ cache_dir="$XDG_CACHE_DIR" # XDG Base Directory specification.
12
+ elif [[ -n "$LOCALAPPDATA" ]]; then
13
+ cache_dir="$LOCALAPPDATA" # Windows.
14
+ elif [[ -n "$USERPROFILE" ]]; then
15
+ cache_dir="$USERPROFILE/.cache" # Windows (fallback).
16
+ elif [[ -d "$HOME/Library/Caches" ]]; then
17
+ cache_dir="$HOME/Library/Caches" # MacOS.
18
+ elif [[ -n "$HOME" ]]; then
19
+ cache_dir="$HOME/.cache" # Linux-like.
20
+ elif [[ -d ~/.cache ]]; then
21
+ cache_dir="~/.cache" # Linux-like (fallback).
22
+ else
23
+ cache_dir="$(pwd)/.cache" # EVG task directory (fallback).
24
+ fi
25
+
26
+ mkdir -p "$cache_dir/mongo-c-driver" || exit
27
+ cache_dir="$(cd "$cache_dir/mongo-c-driver" && pwd)" || exit
28
+
29
+ printf "MONGO_C_DRIVER_CACHE_DIR: %s\n" "$cache_dir" >|expansions.set-cache-dir.yml
30
+ - command : expansions.update
31
+ type : setup
32
+ params :
33
+ file : expansions.set-cache-dir.yml
11
34
- command : subprocess.exec
12
35
type : setup
13
36
params :
14
37
binary : bash
15
38
working_dir : mongoc
16
- add_expansions_to_env : true
39
+ include_expansions_in_env :
40
+ - MONGO_C_DRIVER_CACHE_DIR
17
41
args :
18
42
- -c
19
- - .evergreen/scripts/abi-compliance-check.sh
43
+ - .evergreen/scripts/abi-compliance-check-setup .sh
20
44
- command : subprocess.exec
21
45
type : test
22
46
params :
23
47
binary : bash
24
48
working_dir : mongoc
25
- env :
26
- AWS_ACCESS_KEY_ID : ${aws_key}
27
- AWS_SECRET_ACCESS_KEY : ${aws_secret}
49
+ add_expansions_to_env : true
50
+ include_expansions_in_env :
51
+ - MONGO_C_DRIVER_CACHE_DIR
28
52
args :
29
53
- -c
30
- - |
31
- aws s3 cp abi-compliance/compat_reports s3://mciuploads/mongo-c-driver/${build_variant}/${revision}/${version_id}/${build_id}/abi-compliance/compat_reports --recursive --acl public-read --region us-east-1
32
- [[ ! -f ./abi-compliance/abi-error.txt ]]
54
+ - .evergreen/scripts/abi-compliance-check.sh
33
55
- command : s3.put
56
+ type : system
34
57
params :
35
58
display_name : " ABI Report:"
36
59
aws_key : ${aws_key}
@@ -39,7 +62,18 @@ functions:
39
62
content_type : text/html
40
63
local_files_include_filter : mongoc/abi-compliance/compat_reports/**/*.html
41
64
permissions : public-read
42
- remote_file : mongo-c-driver/${build_variant}/${revision}/${version_id}/${build_id}/abi-compliance/compat_report.html
65
+ remote_file : mongo-c-driver/${branch_name}/${revision}/${version_id}/${build_id}/${task_id}/${execution}/abi-compliance-check/
66
+ - command : s3.put
67
+ type : system
68
+ params :
69
+ display_name : " ABI Compliance Check: "
70
+ aws_key : ${aws_key}
71
+ aws_secret : ${aws_secret}
72
+ bucket : mciuploads
73
+ content_type : text/plain
74
+ local_files_include_filter : abi-compliance/logs/**/log.txt
75
+ permissions : public-read
76
+ remote_file : mongo-c-driver/${branch_name}/${revision}/${version_id}/${build_id}/${task_id}/${execution}/abi-compliance-check/
43
77
backtrace :
44
78
- command : subprocess.exec
45
79
params :
@@ -551,6 +585,38 @@ functions:
551
585
args :
552
586
- -c
553
587
- .evergreen/scripts/compile-scan-build.sh
588
+ set-cache-dir :
589
+ - command : subprocess.exec
590
+ type : setup
591
+ params :
592
+ binary : bash
593
+ args :
594
+ - -c
595
+ - |
596
+ if [[ -n "$XDG_CACHE_DIR" ]]; then
597
+ cache_dir="$XDG_CACHE_DIR" # XDG Base Directory specification.
598
+ elif [[ -n "$LOCALAPPDATA" ]]; then
599
+ cache_dir="$LOCALAPPDATA" # Windows.
600
+ elif [[ -n "$USERPROFILE" ]]; then
601
+ cache_dir="$USERPROFILE/.cache" # Windows (fallback).
602
+ elif [[ -d "$HOME/Library/Caches" ]]; then
603
+ cache_dir="$HOME/Library/Caches" # MacOS.
604
+ elif [[ -n "$HOME" ]]; then
605
+ cache_dir="$HOME/.cache" # Linux-like.
606
+ elif [[ -d ~/.cache ]]; then
607
+ cache_dir="~/.cache" # Linux-like (fallback).
608
+ else
609
+ cache_dir="$(pwd)/.cache" # EVG task directory (fallback).
610
+ fi
611
+
612
+ mkdir -p "$cache_dir/mongo-c-driver" || exit
613
+ cache_dir="$(cd "$cache_dir/mongo-c-driver" && pwd)" || exit
614
+
615
+ printf "MONGO_C_DRIVER_CACHE_DIR: %s\n" "$cache_dir" >|expansions.set-cache-dir.yml
616
+ - command : expansions.update
617
+ type : setup
618
+ params :
619
+ file : expansions.set-cache-dir.yml
554
620
start-load-balancer :
555
621
- command : subprocess.exec
556
622
type : setup
0 commit comments