From c17f02810c86090b74c9fc7d99d867b151fec12a Mon Sep 17 00:00:00 2001 From: Blyron <53337103+Blyron@users.noreply.github.com> Date: Tue, 23 Jul 2024 08:34:24 +0200 Subject: [PATCH] Updated script to use env variable and docs to reflect how to use it (#7968) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Blyron --- Setup.bat => CarlaSetup.bat | 0 Setup.sh => CarlaSetup.sh | 16 +++++++++++++++- UE5_BUILD_README.md | 6 ++++-- 3 files changed, 19 insertions(+), 3 deletions(-) rename Setup.bat => CarlaSetup.bat (100%) rename Setup.sh => CarlaSetup.sh (89%) diff --git a/Setup.bat b/CarlaSetup.bat similarity index 100% rename from Setup.bat rename to CarlaSetup.bat diff --git a/Setup.sh b/CarlaSetup.sh similarity index 89% rename from Setup.sh rename to CarlaSetup.sh index 57a22fd02..2c4777a15 100755 --- a/Setup.sh +++ b/CarlaSetup.sh @@ -35,6 +35,15 @@ satisfies_minimum_version() { set -e sudo echo "Got super powers..." +echo "Parsing GIT_LOCAL_CREDENTIALS local variable " +arrIN=(${GIT_LOCAL_CREDENTIALS//@/ }) +GIT_LOCAL_USER=${arrIN[0]} +GIT_LOCAL_TOKEN=${arrIN[1]} +if [ -z "$GIT_LOCAL_CREDENTIALS" ] +then + echo "Git credentials are not set, they will be requested later on during the download of Unreal Engine Carla fork" +fi + echo "Installing Ubuntu Pacakges..." if ! command -v retry &> /dev/null then @@ -103,7 +112,12 @@ else echo "Found UnrealEngine5 $CARLA_UNREAL_ENGINE_PATH - FAIL" echo "Cloning CARLA UnrealEngine5..." pushd .. - git clone -b ue5-dev-carla https://github.com/CarlaUnreal/UnrealEngine.git UnrealEngine5_carla + if [ -z "$GIT_LOCAL_CREDENTIALS" ] + then + git clone -b ue5-dev-carla https://github.com/CarlaUnreal/UnrealEngine.git UnrealEngine5_carla + else + git clone -b ue5-dev-carla https://$GIT_LOCAL_USER:$GIT_LOCAL_TOKEN@github.com/CarlaUnreal/UnrealEngine.git UnrealEngine5_carla + fi pushd UnrealEngine5_carla echo -e '\n#CARLA UnrealEngine5\nexport CARLA_UNREAL_ENGINE_PATH='$PWD >> ~/.bashrc export CARLA_UNREAL_ENGINE_PATH=$PWD diff --git a/UE5_BUILD_README.md b/UE5_BUILD_README.md index 30983e88f..955e626ab 100644 --- a/UE5_BUILD_README.md +++ b/UE5_BUILD_README.md @@ -16,11 +16,13 @@ Clone the `ue5-dev` branch of CARLA on your local machine: git clone -b ue5-dev https://github.com/carla-simulator/carla.git CarlaUE5 ``` -Run the setup script: +Run the setup script with your GitHub credentials: +> [!NOTE] +> * This version of CARLA requires the **CARLA fork of Unreal Engine 5.3**. You need to link your GitHub account to Epic Games in order to gain permission to clone the UE repository. If you have not already linked your accounts, follow [this guide](https://www.unrealengine.com/en-US/ue4-on-github) ```sh cd CarlaUE5 -bash -x Setup.sh +env GIT_LOCAL_CREDENTIALS=your_user@your_token bash -x Setup.sh ``` The Setup.sh script installs all the required packages, including Cmake, debian packages, Python packages and Unreal Engine 5.3. It also downloads the CARLA content and builds CARLA. This script can therefore take a long time to complete.