diff --git a/utils/ci/scripts/pull_gecco.sh b/utils/ci/scripts/pull_gecco.sh new file mode 100755 index 0000000000000000000000000000000000000000..09f8eb5167edad7c759e514a846336e559863e12 --- /dev/null +++ b/utils/ci/scripts/pull_gecco.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +################################################################################ +# Copyright (c) 2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# SPDX-License-Identifier: EPL-2.0 +################################################################################ + +################################################################################ +# This Script pull the optestrunner binaries and installs them +################################################################################ + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +if [[ -z "${GECCO_DIR}" ]]; then + # If not defined, set a default value + GECCO_DIR="$SCRIPT_DIR/../../../../gecco" + echo "WARN: GECCO_DIR variable is not set. Setting it to: + GECCO_DIR is ${GECCO_DIR}" +fi + +mkdir -p "$GECCO_DIR" && cd "$GECCO_DIR" || exit 1 +rm -rf -- * || { echo "Failed to clean $GECCO_DIR directory"; exit 1; } + +# ToDo: Make it generic +GECCO_BIN="https://ci.eclipse.org/openpass/job/gecco/view/change-requests/job/MR-1/lastSuccessfulBuild/artifact/artifacts/gecco.tar.gz" + +GECCO_FILE=$(basename "$GECCO_BIN") + +#download gecco +download_gecco() { + echo "============================== Downloading $GECCO_FILE ==============================" + wget "${GECCO_BIN}" || { echo "Unable to download astas core $GECCO_FILE from ddad artifactory"; exit 1; } + echo "============================== Download Successful ==============================" +} + +#Extract gecco +extract_gecco() { + echo "============================== Extracting $GECCO_FILE ==============================" + tar -xzvf ./"$GECCO_FILE" || { echo "Unable to install astas core $GECCO_FILE package"; exit 1; } + echo "============================== Extraction Successful ==============================" +} + +download_and_extract_gecco() { + download_gecco + extract_gecco +} + +download_and_extract_gecco \ No newline at end of file