From c53d5b363945de0b722dc671ae0b964dfffdeb18 Mon Sep 17 00:00:00 2001 From: RonaldsonBellande Date: Thu, 9 May 2024 20:18:45 -0400 Subject: [PATCH] latest pushes --- scripts/build_docker.sh | 27 +++++++++++++++++++++++++++ scripts/catkin_setup.sh | 4 ++++ 2 files changed, 31 insertions(+) create mode 100755 scripts/build_docker.sh create mode 100755 scripts/catkin_setup.sh diff --git a/scripts/build_docker.sh b/scripts/build_docker.sh new file mode 100755 index 0000000..abf0b49 --- /dev/null +++ b/scripts/build_docker.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Check user input +if [ "$1" = "ros1" ]; then + # Define the Dockerfile name and tag for ROS 1 + DOCKERFILE="../Dockerfile/Dockerfile.ros1" + IMAGE_NAME="bellande_api_configs_packages_ros1" +elif [ "$1" = "ros2" ]; then + # Define the Dockerfile name and tag for ROS 2 + DOCKERFILE="../Dockerfile/Dockerfile.ros2" + IMAGE_NAME="bellande_api_configs_packages_ros2" +else + echo "Invalid input. Please provide either 'ros1' or 'ros2'." + exit 1 +fi + +TAG="latest" # Change this to the desired tag for your Docker image + +# Build the Docker image +docker build -t $IMAGE_NAME:$TAG -f $DOCKERFILE . + +# Check if the image was built successfully +if [ $? -eq 0 ]; then + echo "Docker image $IMAGE_NAME:$TAG built successfully." +else + echo "Error: Failed to build Docker image." +fi diff --git a/scripts/catkin_setup.sh b/scripts/catkin_setup.sh new file mode 100755 index 0000000..c796c91 --- /dev/null +++ b/scripts/catkin_setup.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +catkin build +source "$CATKIN_WS/devel/setup.bash"