Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more options to run custom scripts at multiple points in the build stages #50

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lreiher
Copy link
Member

@lreiher lreiher commented Jan 23, 2025

  • introduces new configuration variables to specify custom scripts that run at different points in the build process
    • BEFORE_DEPENDENCY_IDENTIFCATION_SCRIPT: runs in dependencies stage after basic setup, before .repos are cloned
    • AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT: runs in dependencies stage at the very end
    • BEFORE_DEPENDENCY_INSTALLATION_SCRIPT: runs in dependencies-install stage as first step in .install-dependencies.sh
    • AFTER_DEPENDENCY_INSTALLATION_SCRIPT: runs in dependencies-install stage as last step in .install-dependencies.sh
  • CUSTOM_SCRIPT_FILE effectively has been renamed to AFTER_DEPENDENCY_INSTALLATION_SCRIPT
  • this feature should add a lot more customizability of the build process, useful/required for, e.g., setting up private apt repositories (Is it possible to add a private debian repository? #23, Adding Rosdep Sources Before Rosdep Install #49)

@lreiher lreiher requested a review from jpbusch January 23, 2025 13:37
@@ -124,19 +140,29 @@ RUN echo "pip install pip \\" >> $WORKSPACE/.install-dependencies.sh && \
fi && \
echo ";" >> $WORKSPACE/.install-dependencies.sh

# add custom installation commands to install script
ARG CUSTOM_SCRIPT_FILE="docker/custom.sh"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename CUSTOM_SCRIPT_FILE?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would tend to keep the naming of the custom.sh

cat src/target/${CUSTOM_SCRIPT_FILE} >> $WORKSPACE/.install-dependencies.sh ; \
# add custom script to run after dependency installation to install script
ARG AFTER_DEPENDENCY_INSTALLATION_SCRIPT="docker/after_dependency_installation.sh"
ARG ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT="false"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need recursion for all variables?

@@ -12,21 +12,24 @@ variables:
ADDITIONAL_DEBS_FILE: docker/additional-debs.txt # Relative filepath to file containing additional apt deb packages to install
ADDITIONAL_FILES_DIR: docker/additional-files # Relative path to directory containing additional files to copy into image"
ADDITIONAL_PIP_FILE: docker/additional-pip-requirements.txt # Relative filepath to file containing additional pip packages to install
AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT: docker/after_dependency_identification.sh # Relative filepath to script containing commands to run after dependency identification
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about this one. Whats the use case for this script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants