-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstep.sh
37 lines (28 loc) · 1.41 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
#!/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.
You have added the **Activate Bitrise Build Cache for Bazel** Step to your Workflow.
However, you don't have an active 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 [[email protected]](mailto:[email protected]) to activate it.
EOF_MSG
set -eo pipefail
echo "Checking whether Bitrise Build Cache is activated for the current 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, configuring the build environment ..."
set -x
# download the Bitrise Build Cache CLI
export BITRISE_BUILD_CACHE_CLI_VERSION="v0.15.15"
curl --retry 5 -sSfL 'https://raw.githubusercontent.com/bitrise-io/bitrise-build-cache-cli/main/install/installer.sh' | sh -s -- -b /tmp/bin -d $BITRISE_BUILD_CACHE_CLI_VERSION
# run the Bitrise Build Cache CLI
/tmp/bin/bitrise-build-cache enable-for bazel --with-rbe="$enable_rbe"