-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstep.sh
49 lines (37 loc) · 1.58 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
45
46
47
48
49
#!/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 [[email protected]](mailto:[email protected]) 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.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
# the cli command without the -d flag
cmd="/tmp/bin/bitrise-build-cache save-xcode-deriveddata-files --project-root $project_root_path --deriveddata-path $derived_data_path"
if [ "$verbose" = "true" ]; then
cmd="$cmd -d"
fi
if [ "$follow_symlinks" = "true" ]; then
cmd="$cmd --follow-symlinks"
fi
if [ "$skip_spm" = "true" ]; then
cmd="$cmd --skip-spm"
fi
$cmd