-
Notifications
You must be signed in to change notification settings - Fork 0
/
step.sh
executable file
·49 lines (37 loc) · 1.57 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
#!/bin/bash
THIS_SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${THIS_SCRIPTDIR}/_utils.sh"
source "${THIS_SCRIPTDIR}/_formatted_output.sh"
# init / cleanup the formatted output
echo "" > "${formatted_output_file_path}"
if [ -z "${BITRISE_SOURCE_DIR}" ]; then
write_section_to_formatted_output "# Error"
write_section_start_to_formatted_output '* BITRISE_SOURCE_DIR input is missing'
exit 1
fi
# Update Cocoapods
if [[ "${IS_UPDATE_COCOAPODS}" != "false" ]] ; then
print_and_do_command_exit_on_error bash "${THIS_SCRIPTDIR}/steps-cocoapods-update/step.sh"
else
write_section_to_formatted_output "*Skipping Cocoapods version update*"
fi
print_and_do_command_exit_on_error cd "${BITRISE_SOURCE_DIR}"
if [ -n "${GATHER_PROJECTS}" ]; then
write_section_to_formatted_output "# Gathering project configurations"
# create/cleanup ~/.schemes file
echo "" > ~/.schemes
print_and_do_command_exit_on_error git remote set-head origin -d
for branch in $(git branch -r);
do
print_and_do_command_exit_on_error git checkout -B ${branch}
# remove the prefix "origin/" from the branch name
branch_without_remote=$(printf "%s" "${branch}" | cut -c 8-)
echo "Local branch: ${branch_without_remote}"
print_and_do_command_exit_on_error bash "${THIS_SCRIPTDIR}/run_pod_install.sh"
print_and_do_command_exit_on_error bash "${THIS_SCRIPTDIR}/find_schemes.sh" "${branch_without_remote}"
done
else
write_section_to_formatted_output "# Run pod install"
print_and_do_command_exit_on_error bash "${THIS_SCRIPTDIR}/run_pod_install.sh"
fi
exit 0