Debian Codegraph @

dev/tools/check-cachekey.sh

raw symbols SCIP
1 #!/bin/sh
2
3 REDBOLD="\033[31;1m"
4 RESET="\033[0m"
5
6 redprint()
7 {
8 if [ "$COQ_CI_COLOR" ]; then
9 printf "$REDBOLD%s$RESET\n" "$1"
10 else
11 printf '%s\n' "$1"
12 fi
13 }
14
15 base_hash=$(md5sum dev/ci/docker/old_ubuntu_lts/Dockerfile | head -c 10)
16 base_key=$(grep BASE_CACHEKEY: .gitlab-ci.yml)
17 base_keyhash=${base_key%\"}
18 base_keyhash=${base_keyhash##*-}
19
20 if ! [ "$base_hash" = "$base_keyhash" ]; then
21 >&2 redprint "Bad BASE_CACHEKEY: expected '$base_hash' but got '$base_keyhash'"
22 exit 1
23 fi
24
25 edge_hash=$(md5sum dev/ci/docker/edge_ubuntu/Dockerfile | head -c 10)
26 edge_key=$(grep EDGE_CACHEKEY: .gitlab-ci.yml)
27 edge_keyhash=${edge_key%\"}
28 edge_keyhash=${edge_keyhash##*-}
29
30 if ! [ "$edge_hash" = "$edge_keyhash" ]; then
31 >&2 redprint "Bad EDGE_CACHEKEY: expected '$edge_hash' but got '$edge_keyhash'"
32 exit 1
33 fi