Skip to content

Commit

Permalink
enable non-recursive vcs import
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbusch committed Oct 10, 2023
1 parent 77705e3 commit 4ff69fc
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitlab-ci/docker-ros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ variables:
ENABLE_RECURSIVE_ADDITIONAL_PIP: 'false' # Enable recursive discovery of files named `additional-pip-file`
CUSTOM_SCRIPT_FILE: docker/custom.sh # Relative filepath to script containing custom installation commands
ENABLE_RECURSIVE_CUSTOM_SCRIPT: 'false' # Enable recursive discovery of files named `custom-script-file`
ENABLE_RECURSIVE_VCS_IMPORT: 'true' # Enable recursive discovery of files named `additional-repos-file`
# -----
DOCKER_ROS_GIT_REF: main

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ Create a folder `additional-files` in your `docker` folder (or configure a diffe
- **`enable-recursive-custom-script` | `ENABLE_RECURSIVE_CUSTOM_SCRIPT`**
Enable recursive discovery of files named `custom-script-file`
*default:* `false`
- **`enable-recursive-vcs-import` | `ENABLE_RECURSIVE_VCS_IMPORT`**
Enable recursive discovery of files named `additional-repo-file`
*default:* `true`
- **`git-ssh-known-host-keys` | `GIT_SSH_KNOWN_HOST_KEYS`**
Known SSH host keys for cloning private Git repositories via SSH (may be obtained using `ssh-keyscan`)
- **`git-ssh-private-key` | `GIT_SSH_PRIVATE_KEY`**
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ runs:
ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }}
CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }}
ENABLE_RECURSIVE_CUSTOM_SCRIPT: ${{ inputs.enable-recursive-custom-script }}
ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }}

- name: Set up industrial_ci
if: ${{ inputs.enable-industrial-ci == 'true' }}
Expand Down Expand Up @@ -227,6 +228,7 @@ runs:
ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }}
CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }}
ENABLE_RECURSIVE_CUSTOM_SCRIPT: ${{ inputs.enable-recursive-custom-script }}
ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }}
_ENABLE_IMAGE_PUSH: true
_IMAGE_POSTFIX: ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) && format('_{0}_ci', steps.slugify-ref-name.outputs.slug) || '' }}

Expand Down Expand Up @@ -258,5 +260,6 @@ runs:
ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }}
CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }}
ENABLE_RECURSIVE_CUSTOM_SCRIPT: ${{ inputs.enable-recursive-custom-script }}
ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }}
_ENABLE_IMAGE_PUSH: true
_IMAGE_POSTFIX: ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) && format('_{0}_ci', steps.slugify-ref-name.outputs.slug) || '' }}
7 changes: 6 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ COPY docker/docker-ros/docker/recursive_vcs_import.py /usr/local/bin
RUN apt-get update && \
apt-get install -y python-is-python3 && \
rm -rf /var/lib/apt/lists/*
RUN /usr/local/bin/recursive_vcs_import.py src src/upstream
ARG ENABLE_RECURSIVE_VCS_IMPORT="true"
RUN if [[ $ENABLE_RECURSIVE_ADDITIONAL_DEBS == 'true' ]]; then \
/usr/local/bin/recursive_vcs_import.py src src/upstream ; \
else \
vcs import src/upstream < src/target/.repos ; \
fi

# create install script with list of rosdep dependencies
RUN echo "set -e" >> $WORKSPACE/.install-dependencies.sh && \
Expand Down
1 change: 1 addition & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ build_image() {
$(if [[ -n "${ENABLE_RECURSIVE_ADDITIONAL_PIP}" ]]; then echo "--build-arg ENABLE_RECURSIVE_ADDITIONAL_PIP=${ENABLE_RECURSIVE_ADDITIONAL_PIP}"; fi) \
$(if [[ -n "${CUSTOM_SCRIPT_FILE}" ]]; then echo "--build-arg CUSTOM_SCRIPT_FILE=${CUSTOM_SCRIPT_FILE}"; fi) \
$(if [[ -n "${ENABLE_RECURSIVE_CUSTOM_SCRIPT}" ]]; then echo "--build-arg ENABLE_RECURSIVE_CUSTOM_SCRIPT=${ENABLE_RECURSIVE_CUSTOM_SCRIPT}"; fi) \
$(if [[ -n "${ENABLE_RECURSIVE_VCS_IMPORT}" ]]; then echo "--build-arg ENABLE_RECURSIVE_VCS_IMPORT=${ENABLE_RECURSIVE_VCS_IMPORT}"; fi) \
.
echo "Successfully built stage '${TARGET}' for platform '${PLATFORM}' as '${IMAGE}'"
}
Expand Down
1 change: 1 addition & 0 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ADDITIONAL_PIP_FILE="${ADDITIONAL_PIP_FILE:-}"
ENABLE_RECURSIVE_ADDITIONAL_PIP="${ENABLE_RECURSIVE_ADDITIONAL_PIP:-}"
CUSTOM_SCRIPT_FILE="${CUSTOM_SCRIPT_FILE:-}"
ENABLE_RECURSIVE_CUSTOM_SCRIPT="${ENABLE_RECURSIVE_CUSTOM_SCRIPT:-}"
ENABLE_RECURSIVE_VCS_IMPORT="${ENABLE_RECURSIVE_VCS_IMPORT:-}"
_ENABLE_IMAGE_PUSH="${_ENABLE_IMAGE_PUSH:-false}"
_IMAGE_POSTFIX="${_IMAGE_POSTFIX:-""}"

Expand Down
1 change: 1 addition & 0 deletions templates/docker-compose.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ x-build: &build
ENABLE_RECURSIVE_ADDITIONAL_DEBS: $ENABLE_RECURSIVE_ADDITIONAL_DEBS
ENABLE_RECURSIVE_ADDITIONAL_PIP: $ENABLE_RECURSIVE_ADDITIONAL_PIP
ENABLE_RECURSIVE_CUSTOM_SCRIPT: $ENABLE_RECURSIVE_CUSTOM_SCRIPT
ENABLE_RECURSIVE_VCS_IMPORT: $ENABLE_RECURSIVE_VCS_IMPORT
GIT_HTTPS_PASSWORD: $GIT_HTTPS_PASSWORD
GIT_HTTPS_SERVER: $GIT_HTTPS_SERVER
GIT_HTTPS_USER: $GIT_HTTPS_USER
Expand Down

0 comments on commit 4ff69fc

Please sign in to comment.