-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci_build_local.sh
executable file
·44 lines (31 loc) · 950 Bytes
/
ci_build_local.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
# Runs ci_build.sh on your local machine by first setting
# up some env vars to imitate what GH actions would do.
set -eo pipefail
error_exit() {
local -r msg="$1"
echo -e "${msg}"
exit 1
}
check_for_installed_binary() {
local -r binary_name=$1
command -v "${binary_name}" 1>/dev/null \
|| error_exit "${GREEN}${binary_name}${RED} is not installed${NC}"
}
main() {
check_for_installed_binary "xmllint"
check_for_installed_binary "wget"
check_for_installed_binary "java"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Set the env vars that ci_build.sh needs
export BUILD_IS_SCHEMA_RELEASE=false
export BUILD_DIR="${SCRIPT_DIR}"
# Clear out old stuff
rm -f "${BUILD_DIR}/pipelines/generated/*"
echo "Using BUILD_DIR: ${BUILD_DIR}"
pushd "${BUILD_DIR}" > /dev/null
# Run the CI build locally
"${BUILD_DIR}/ci_build.sh"
popd > /dev/null
}
main "$@"