Skip to content

Commit

Permalink
added git_repo_status.sh tool.
Browse files Browse the repository at this point in the history
  • Loading branch information
akoerner1 committed Nov 15, 2023
1 parent 6d352bc commit 1ba5eec
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
8 changes: 8 additions & 0 deletions adore_cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ services:
image: ${ADORE_CLI_PROJECT}:${ADORE_CLI_TAG:-latest}
container_name: ${ADORE_CLI_PROJECT}
user: ${USER}
hostname: ${HOSTNAME:-ADORe-CLI}
network_mode: "host"
environment:
- HOSTNAME=${HOSTNAME:-ADORe-CLI}
- TEST_SCENARIOS=${TEST_SCENARIOS:-baseline_test.launch}
- "BAG_OUTPUT_DIRECTORY=${SOURCE_DIRECTORY}/.log/.ros/bag_files"
- "ROS_HOME=${SOURCE_DIRECTORY}/.log/.ros"
Expand All @@ -19,6 +21,7 @@ services:
network: host
dockerfile: ${ADORE_CLI_MAKEFILE_PATH}/docker/Dockerfile.adore_cli
args:
- HOSTNAME=${HOSTNAME:-ADORe-CLI}
- ADORE_CLI_TAG=${ADORE_CLI_TAG:-latest}
- USER=${USER}
- UID=${UID:-1000}
Expand All @@ -35,8 +38,10 @@ services:
image: ${ADORE_CLI_PROJECT_X11_DISPLAY}:${ADORE_CLI_TAG:-latest}
container_name: ${ADORE_CLI_PROJECT}
user: ${USER}
hostname: ${HOSTNAME:-ADORe-CLI}
network_mode: "host"
environment:
- HOSTNAME=${HOSTNAME:-ADORe-CLI}
- ADORE_SOURCE_DIRECTORY=${SOURCE_DIRECTORY}
- SOURCE_DIRECTORY=${SOURCE_DIRECTORY}
- ADORE_CLI_WORKING_DIRECTORY=${ADORE_CLI_WORKING_DIRECTORY}
Expand All @@ -60,6 +65,7 @@ services:
network: host
dockerfile: ${ADORE_CLI_MAKEFILE_PATH}/docker/Dockerfile.adore_cli_x11_display
args:
- HOSTNAME=${HOSTNAME:-ADORe-CLI}
- ADORE_CLI_TAG=${ADORE_CLI_TAG:-latest}
- ADORE_IF_ROS_TAG=${ADORE_IF_ROS_TAG:-latest}
- USER=${USER}
Expand All @@ -72,3 +78,5 @@ services:
- ./:/tmp/adore_cli
- ${SOURCE_DIRECTORY}:/tmp/adore
- ${SOURCE_DIRECTORY}:${SOURCE_DIRECTORY}
extra_hosts:
- "${HOSTNAME:-ADORe-CLI}:127.0.0.1"
8 changes: 3 additions & 5 deletions docker/Dockerfile.adore_cli
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
ARG USER
ARG UID
ARG GID
ARG HOSTNAME=ADORe-CLI

#FROM ros:iron-ros-core-jammy AS adore_cli

Expand All @@ -11,8 +10,8 @@ FROM ros:iron-ros-core-jammy AS adore_cli
ARG USER
ARG UID
ARG GID
ARG HOSTNAME
ENV HOSTNAME=${HOSTNAME}

#RUN apt-get update && cat /etc/os-release && apt-cache search setuptools && exit 1

RUN apt-get update && \
apt-get install --no-install-recommends -y \
Expand All @@ -26,14 +25,13 @@ RUN apt-get update && \
ros-iron-ros-base \
python3-pip \
ros-iron-foxglove-bridge \
&& \
&& \
rm -rf /var/lib/apt/lists/*

RUN python3 -m pip install setuptools==58.2.0

RUN useradd --create-home ${USER}

RUN echo "127.0.1.1 ${HOSTNAME}" >> /etc/hosts

RUN usermod -u ${UID} ${USER} && groupmod -g ${GID} ${USER}
RUN chown -R ${UID}:${GID} $$HOME | true
Expand Down
2 changes: 1 addition & 1 deletion docker/files/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ PROMPT='%B%F{grey}%F{cyan}ADORe CLI:%F %{$fg_bold[green]%}%c %{$reset_color%}$(g


alias help='bash /tmp/adore_cli/tools/adore_cli_help.sh'

source /opt/ros/iron/setup.zsh

6 changes: 4 additions & 2 deletions tools/adore_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -euo pipefail
SCRIPT_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
echoerr (){ printf "%s" "$@" >&2;}
exiterr (){ echoerr "$@"; exit 1;}

SCRIPT_DIRECTORY="/tmp/adore/tools/adore_cli/tools"

#SOURCE_DIRECTORY=${SOURCE_DIRECTORY:-/tmp/adore}
ADORE_CLI_DIRECTORY=${ADORE_CLI_DIRECTORY:-/tmp/adore_cli}
Expand Down Expand Up @@ -35,18 +35,20 @@ bash tools/adore_cli_motd.sh

printf "\n"

bash "${SCRIPT_DIRECTORY}/git_repo_status.sh"
#echo " SOURCE_DIRECTORY: ${SOURCE_DIRECTORY}"
#echo " ADORE_CLI_WORKING_DIRECTORY: ${ADORE_CLI_WORKING_DIRECTORY}"
#echo " CATKIN_WORKSPACE_DIRECTORY: ${CATKIN_WORKSPACE_DIRECTORY}"


cd "${ADORE_CLI_WORKING_DIRECTORY}"

echo " Vehicle: "
if [ -z ${VEHICLE_NAME+x} ]; then
printf " No vehicle set.\n\n";
else
printf " Vehicle environment set to: ${VEHICLE_NAME}\n\n";
fi
zsh

source /opt/ros/iron/setup.zsh
##source /opt/ros/iron/setup.zsh
5 changes: 4 additions & 1 deletion tools/git_repo_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ RESET='\033[0m'
(
cd ${SCRIPT_DIRECTORY}
if [ ! -z "$(git status --porcelain)" ]; then
printf "${BOLD}${BLINK}${ORANGE}WARNING${RESET}: The adore_cli repo has changes. Rebuild the adore_cli with 'make build_adore_cli' for new changes to take effect.\n"
printf " ${BOLD}${BLINK}${ORANGE}WARNING:${RESET} The ${BOLD}adore_cli${RESET} repo has changes. \n Rebuild the adore_cli with 'make build_adore_cli' for new changes to take effect.\n"
printf " Commit or discard changes to the adore_cli repo to clear this message.\n\n"
git status
echo ""
fi
)

0 comments on commit 1ba5eec

Please sign in to comment.