Skip to content

Commit

Permalink
Update react component names
Browse files Browse the repository at this point in the history
  • Loading branch information
MihirGore23 committed Aug 28, 2024
1 parent 01defa0 commit 0d0ac58
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions scripts/develop_academy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/sh

# Initialize variables with default values
ram_version="https://github.com/JdeRobot/RoboticsApplicationManager.git"
branch="humble-devel"
radi_version="humble"
gpu_mode="false"
nvidia="false"
compose_file="dev_humble_cpu"

# Loop through the arguments using a while loop
while getopts ":r:b:i:g:n" opt; do
case $opt in
r) ram_version="$OPTARG" ;;
b) branch="$OPTARG" ;;
i) radi_version="$OPTARG" ;;
g) gpu_mode="true" ;;
n) nvidia="true" ;;
\?) echo "Invalid option: -$OPTARG" >&2 ;; # If an invalid option is provided, print an error message
esac
done

echo "RAM src: $ram_version"
echo "RAM branch: $branch"
echo "RoboticsBackend version: $radi_version"

# Install docker-compose if not installed
if ! command -v docker-compose &> /dev/null; then
sudo apt install docker-compose
fi

# Clone the desired RAM fork and branch
if ! [ -d src ]; then
git clone $ram_version -b $branch src;
chown -R $(id -u):$(id -g) src/
fi

# Prepare nvm
export NVM_DIR=$HOME/.nvm;
source $NVM_DIR/nvm.sh;
if ! command -v nvm &> /dev/null; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR=$HOME/.nvm;
source $NVM_DIR/nvm.sh;
fi

# Prepare yarn
if ! command -v yarn --version &> /dev/null; then
npm install --global yarn
fi

# Prepare the frontend
nvm install 16
nvm use 16
cd react_frontend/
yarn install
yarn build
cd ..

# Prepare the compose file
if [ "$gpu_mode" = "true" ]; then
compose_file="dev_humble_gpu"
fi
if [ "$nvidia" = "true" ]; then
compose_file="dev_humble_nvidia"
fi
cp compose_cfg/$compose_file.yaml docker-compose.yaml

# Proceed with docker-compose commands
if [ "$nvidia" = "true" ]; then
docker compose --compatibility up
else
docker compose up
fi
docker compose down;
rm docker-compose.yaml

0 comments on commit 0d0ac58

Please sign in to comment.