2019-11-30 15:36:27 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2021-03-22 15:14:11 +00:00
|
|
|
#
|
|
|
|
# Create directory for license activation
|
|
|
|
#
|
|
|
|
|
|
|
|
ACTIVATE_LICENSE_PATH="$GITHUB_WORKSPACE/_activate-license"
|
|
|
|
mkdir -p "$ACTIVATE_LICENSE_PATH"
|
|
|
|
|
2022-01-17 18:30:18 +00:00
|
|
|
#
|
2022-02-07 00:32:25 +00:00
|
|
|
# Check if apt-get is available if in package mode (if not, we must exit since we need to install jq)
|
2022-01-17 18:30:18 +00:00
|
|
|
#
|
|
|
|
if [ "$PACKAGE_MODE" = "true" ]; then
|
2022-01-17 18:58:59 +00:00
|
|
|
echo "Checking if apt-get is installed to install jq."
|
2022-01-17 18:30:18 +00:00
|
|
|
apt-get --version > /dev/null 2>&1
|
|
|
|
if [ $? -ne 0 ]; then
|
2022-02-07 00:32:25 +00:00
|
|
|
echo "apt-get is not installed. Exiting..."
|
|
|
|
exit 1
|
2022-01-17 18:30:18 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# install jq
|
|
|
|
apt-get update \
|
|
|
|
&& apt-get upgrade -y --force-yes \
|
|
|
|
&& apt-get install -y --force-yes \
|
|
|
|
jq \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
|
|
|
|
fi
|
|
|
|
|
2019-11-30 15:36:27 +00:00
|
|
|
#
|
2020-01-29 22:37:11 +00:00
|
|
|
# Run steps
|
2019-11-30 15:36:27 +00:00
|
|
|
#
|
|
|
|
|
2020-01-29 22:37:11 +00:00
|
|
|
source /steps/activate.sh
|
2021-11-03 09:25:06 +00:00
|
|
|
source /steps/set_gitcredential.sh
|
2020-01-29 22:37:11 +00:00
|
|
|
source /steps/run_tests.sh
|
|
|
|
source /steps/return_license.sh
|
2019-11-30 15:36:27 +00:00
|
|
|
|
2021-03-22 15:14:11 +00:00
|
|
|
#
|
|
|
|
# Remove license activation directory
|
|
|
|
#
|
|
|
|
|
|
|
|
rm -r "$ACTIVATE_LICENSE_PATH"
|
|
|
|
|
2020-09-27 19:19:29 +00:00
|
|
|
#
|
|
|
|
# Instructions for debugging
|
|
|
|
#
|
|
|
|
|
|
|
|
if [[ $TEST_RUNNER_EXIT_CODE -gt 0 ]]; then
|
|
|
|
echo ""
|
|
|
|
echo "###########################"
|
|
|
|
echo "# Failure #"
|
|
|
|
echo "###########################"
|
|
|
|
echo ""
|
|
|
|
echo "Please note that the exit code is not very descriptive."
|
|
|
|
echo "Most likely it will not help you solve the issue."
|
|
|
|
echo ""
|
|
|
|
echo "To find the reason for failure: please search for errors in the log above."
|
|
|
|
echo ""
|
|
|
|
fi;
|
|
|
|
|
2019-11-30 15:36:27 +00:00
|
|
|
#
|
2020-01-29 22:37:11 +00:00
|
|
|
# Exit with code from the build step.
|
2019-11-30 15:36:27 +00:00
|
|
|
#
|
|
|
|
|
2021-08-28 17:48:23 +00:00
|
|
|
if [[ $USE_EXIT_CODE == true || $TEST_RUNNER_EXIT_CODE -ne 2 ]]; then
|
2020-01-29 22:37:11 +00:00
|
|
|
exit $TEST_RUNNER_EXIT_CODE
|
2021-02-27 18:13:19 +00:00
|
|
|
fi;
|