-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
76 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 "$@" |