diff --git a/.gitlab-ci/docker-ros.yml b/.gitlab-ci/docker-ros.yml index 7dd0052..5a203d2 100644 --- a/.gitlab-ci/docker-ros.yml +++ b/.gitlab-ci/docker-ros.yml @@ -9,47 +9,49 @@ workflow: variables: - TARGET: run # Target stage of Dockerfile (comma-separated list) [dev|run] - PLATFORM: amd64 # Target platform architecture (comma-separated list) [amd64|arm64|...] + 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 BASE_IMAGE: '' # Base image name:tag (required) - COMMAND: '' # Launch command of run image (required if target=run) - IMAGE_NAME: ${CI_REGISTRY_IMAGE} # Image name of run image - IMAGE_TAG: latest # Image tag of run image - DEV_IMAGE_NAME: ${IMAGE_NAME} # Image name of dev image - DEV_IMAGE_TAG: ${IMAGE_TAG}-dev # Image tag of dev image - SLIM_IMAGE_NAME: ${IMAGE_NAME} # Image name of slim run image - SLIM_IMAGE_TAG: ${IMAGE_TAG}-slim # Image tag of slim run image + BLACKLISTED_PACKAGES_FILE: docker/blacklisted-packages.txt # Relative filepath to file containing the blacklisted packages BUILD_CONTEXT: . # Build context of Docker build process - REGISTRY: ${CI_REGISTRY} # Docker registry to push images to - REGISTRY_USER: ${CI_REGISTRY_USER} # Docker registry username - REGISTRY_PASSWORD: ${CI_REGISTRY_PASSWORD} # Docker registry password + COMMAND: '' # Launch command of run image (required if target=run) + CUSTOM_SCRIPT_FILE: docker/custom.sh # Relative filepath to script containing custom installation commands + DISABLE_ROS_INSTALLATION: 'false' # Disable automatic installation of `ros-$ROS_DISTRO-ros-core` package, e.g., if ROS is already installed in `base-image` and package is not available for the OS + DOCKER_ROS_GIT_REF: main # Git ref of *docker-ros* to run in CI ENABLE_INDUSTRIAL_CI: 'false' # Enable industrial_ci - ENABLE_SLIM: 'true' # Enable an extra slimmed run image via slim (only if run stage is targeted) - SLIM_BUILD_ARGS: '--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false' # Arguments to `slim build` (except for `--target` and `--tag`) - ENABLE_SINGLEARCH_PUSH: 'false' # Enable push of single arch images with [-amd64|-arm64] postfix ENABLE_PUSH_AS_LATEST: 'false' # Push images with tag `latest`/`latest-dev` in addition to the configured image names - RMW_IMPLEMENTATION: 'rmw_cyclonedds_cpp' # RMW implementation to use (only for ROS 2) - RMW_ZENOH_GIT_REF: '28d917e0532fed6e9703f044662298f2b3553716' # Git ref of rmw_zenoh repo to build if `RMW_IMPLEMENTATION=rmw_zenoh_cpp` - ROS_DISTRO: '' # ROS Distro (required if ROS is not installed in `base-image`) - DISABLE_ROS_INSTALLATION: 'false' # Disable automatic installation of `ros-$ROS_DISTRO-ros-core` package, e.g., if ROS is already installed in `base-image` and package is not available for the OS - GIT_HTTPS_SERVER: ${CI_SERVER_HOST} # Server URL (without protocol) for cloning private Git repositories via HTTPS - GIT_HTTPS_USER: gitlab-ci-token # Username for cloning private Git repositories via HTTPS - GIT_HTTPS_PASSWORD: ${CI_JOB_TOKEN} # Password for cloning private Git repositories via HTTPS - GIT_SSH_PRIVATE_KEY: '' # SSH private key for cloning private Git repositories via SSH - GIT_SSH_KNOWN_HOST_KEYS: '' # Known SSH host keys for cloning private Git repositories via SSH (may be obtained using `ssh-keyscan`) - ADDITIONAL_DEBS_FILE: docker/additional-debs.txt # Relative filepath to file containing additional apt deb packages to install ENABLE_RECURSIVE_ADDITIONAL_DEBS: 'false' # Enable recursive discovery of files named `additional-debs-file` - 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 ENABLE_RECURSIVE_ADDITIONAL_PIP: 'false' # Enable recursive discovery of files named `additional-pip-file` - BLACKLISTED_PACKAGES_FILE: docker/blacklisted-packages.txt # Relative filepath to file containing the blacklisted packages ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: 'false' # Enable recursive discovery of files named `blacklisted-packages-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` - VCS_IMPORT_FILE: .repos # Relative filepath to file containing additional repos to install via vcstools (only relevant if ENABLE_RECURSIVE_VCS_IMPORT=false) ENABLE_RECURSIVE_VCS_IMPORT: 'true' # Enable recursive discovery of files named `*.repos` - # ----- - DOCKER_ROS_GIT_REF: main + ENABLE_SINGLEARCH_PUSH: 'false' # Enable push of single arch images with [-amd64|-arm64] postfix + ENABLE_SLIM: 'true' # Enable an extra slimmed run image via slim (only if run stage is targeted) + GIT_HTTPS_PASSWORD: ${CI_JOB_TOKEN} # Password for cloning private Git repositories via HTTPS + GIT_HTTPS_SERVER: ${CI_SERVER_HOST} # Server URL (without protocol) for cloning private Git repositories via HTTPS + GIT_HTTPS_USER: gitlab-ci-token # Username for cloning private Git repositories via HTTPS + 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: '' # SSH private key for cloning private Git repositories via SSH + IMAGE_NAME: ${CI_REGISTRY_IMAGE} # Image name of run image + IMAGE_TAG: latest # Image tag of run image + PLATFORM: amd64 # Target platform architecture (comma-separated list) [amd64|arm64|...] + REGISTRY_PASSWORD: ${CI_REGISTRY_PASSWORD} # Docker registry password + REGISTRY_USER: ${CI_REGISTRY_USER} # Docker registry username + REGISTRY: ${CI_REGISTRY} # Docker registry to push images to + RMW_IMPLEMENTATION: 'rmw_cyclonedds_cpp' # RMW implementation to use (only for ROS 2) + RMW_ZENOH_GIT_REF: '28d917e0532fed6e9703f044662298f2b3553716' # Git ref of rmw_zenoh repo to build if `RMW_IMPLEMENTATION=rmw_zenoh_cpp` + ROS_DISTRO: '' # ROS Distro (required if ROS is not installed in `base-image`) + SLIM_BUILD_ARGS: '--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false' # Arguments to `slim build` (except for `--target` and `--tag`) + TARGET: run # Target stage of Dockerfile (comma-separated list) [dev|run] + VCS_IMPORT_FILE: .repos # Relative filepath to file containing additional repos to install via vcstools (only relevant if ENABLE_RECURSIVE_VCS_IMPORT=false) + + DEV_IMAGE_NAME: ${IMAGE_NAME} # Image name of dev image + DEV_IMAGE_TAG: ${IMAGE_TAG}-dev # Image tag of dev image + SLIM_IMAGE_NAME: ${IMAGE_NAME} # Image name of slim run image + SLIM_IMAGE_TAG: ${IMAGE_TAG}-slim # Image tag of slim run image + + # -------------------- _RUN_IMAGE: ${IMAGE_NAME}:${IMAGE_TAG} _DEV_IMAGE: ${DEV_IMAGE_NAME}:${DEV_IMAGE_TAG} diff --git a/README.md b/README.md index 2f7623c..83f91ce 100644 --- a/README.md +++ b/README.md @@ -392,7 +392,7 @@ The password of the custom user is set to its username (`dockeruser:dockeruser` *e.g., if ROS is already installed in `base-image` and package is not available for the OS* *default:* `false` - **`-` | `DOCKER_ROS_GIT_REF`** - Git reference of *docker-ros* to run in CI + Git ref of *docker-ros* to run in CI *default:* `main` - **`enable-checkout` | `-`** Enable [*checkout*](https://github.com/actions/checkout) action to (re-)download your repository prior to running the pipeline diff --git a/action.yml b/action.yml index acf76cd..aa2e022 100644 --- a/action.yml +++ b/action.yml @@ -5,159 +5,119 @@ branding: icon: package inputs: - - target: - description: "Target stage of Dockerfile (comma-separated list) [dev|run]" - default: run - - platform: - description: "Target platform architecture (comma-separated list) [amd64|arm64|...]" - + additional-debs-file: + description: "Relative filepath to file containing additional apt deb packages to install" + default: docker/additional-debs.txt + additional-files-dir: + description: "Relative path to directory containing additional files to copy into image" + default: docker/additional-files + additional-pip-file: + description: "Relative filepath to file containing additional pip packages to install" + default: docker/additional-pip-requirements.txt base-image: description: "Base image name:tag" required: true - + blacklisted-packages-file: + description: "Relative filepath to file containing blacklisted packages to remove from workspace" + default: docker/blacklisted-packages.txt + build-context: + description: "Build context of Docker build process" + default: ${{ github.workspace }} command: description: "Launch command of run image (required if target=run)" - - image-name: - description: "Image name of run image" - default: ghcr.io/${{ github.repository }} - - image-tag: - description: "Image tag of run image" - default: latest - + custom-script-file: + description: "Relative filepath to script containing custom installation commands" + default: docker/custom.sh dev-image-name: description: "Image name of dev image" default: ghcr.io/${{ github.repository }} - dev-image-tag: description: "Image tag of dev image" - - slim-image-name: - description: "Image name of slim run image" - default: ghcr.io/${{ github.repository }} - - slim-image-tag: - description: "Image tag of slim run image" - - build-context: - description: "Build context of Docker build process" - default: ${{ github.workspace }} - - registry: - description: "Docker registry to push images to" - default: ghcr.io - - registry-user: - description: "Docker registry username" - default: ${{ github.actor }} - - registry-password: - description: "Docker registry password" - default: ${{ github.token }} - - rmw-implementation: - description: "RMW implementation to use (only for ROS 2)" - default: rmw_cyclonedds_cpp - - rmw-zenoh-git-ref: - description: "Git ref of rmw_zenoh repo to build if `RMW_IMPLEMENTATION=rmw_zenoh_cpp`" - default: 28d917e0532fed6e9703f044662298f2b3553716 - - ros-distro: - description: "ROS Distro (required if ROS is not installed in `base-image`)" - disable-ros-installation: description: "Disable automatic installation of `ros-$ROS_DISTRO-ros-core` package, e.g., if ROS is already installed in `base-image` and package is not available for the OS" default: false - - git-https-server: - description: "Server URL (without protocol) for cloning private Git repositories via HTTPS" - default: "github.com" - - git-https-user: - description: "Username for cloning private Git repositories via HTTPS" - default: ${{ github.actor }} - - git-https-password: - description: "Password for cloning private Git repositories via HTTPS" - default: ${{ github.token }} - - git-ssh-private-key: - description: "SSH private key for cloning private Git repositories via SSH" - - git-ssh-known-host-keys: - description: "Known SSH host keys for cloning private Git repositories via SSH (may be obtained using `ssh-keyscan`)" - - additional-debs-file: - description: "Relative filepath to file containing additional apt deb packages to install" - default: docker/additional-debs.txt - + enable-checkout: + description: "Enable checkout action to (re-)download your repository prior to running the pipeline" + default: true + enable-checkout-lfs: + description: "Enable Git LFS support for the checkout action" + default: true + enable-checkout-submodules: + description: "Enable submodules for the checkout action (false|true|recursive)" + default: recursive + enable-industrial-ci: + description: "Enable industrial_ci" + default: false + enable-push-as-latest: + description: "Push images with tag `latest`/`latest-dev` in addition to the configured image names" + default: false enable-recursive-additional-debs: description: "Enable recursive discovery of files named `additional-debs-file`" default: false - - additional-files-dir: - description: "Relative path to directory containing additional files to copy into image" - default: docker/additional-files - - additional-pip-file: - description: "Relative filepath to file containing additional pip packages to install" - default: docker/additional-pip-requirements.txt - enable-recursive-additional-pip: description: "Enable recursive discovery of files named `additional-pip-file`" default: false - - blacklisted-packages-file: - description: "Relative filepath to file containing blacklisted packages to remove from workspace" - default: docker/blacklisted-packages.txt - enable-recursive-blacklisted-packages: description: "Enable recursive discovery of files named `blacklisted-packages-file`" default: false - - custom-script-file: - description: "Relative filepath to script containing custom installation commands" - default: docker/custom.sh - enable-recursive-custom-script: description: "Enable recursive discovery of files named `custom-script-file`" default: false - - enable-industrial-ci: - description: "Enable industrial_ci" + enable-singlearch-push: + description: "Enable push of single arch images with [-amd64|-arm64] postfix" default: false - enable-slim: description: "Enable an extra slimmed run image via slim (only if run stage is targeted)" default: true - + git-https-password: + description: "Password for cloning private Git repositories via HTTPS" + default: ${{ github.token }} + git-https-server: + description: "Server URL (without protocol) for cloning private Git repositories via HTTPS" + default: "github.com" + git-https-user: + description: "Username for cloning private Git repositories via HTTPS" + default: ${{ github.actor }} + git-ssh-known-host-keys: + description: "Known SSH host keys for cloning private Git repositories via SSH (may be obtained using `ssh-keyscan`)" + git-ssh-private-key: + description: "SSH private key for cloning private Git repositories via SSH" + image-name: + description: "Image name of run image" + default: ghcr.io/${{ github.repository }} + image-tag: + description: "Image tag of run image" + default: latest + platform: + description: "Target platform architecture (comma-separated list) [amd64|arm64|...]" + registry: + description: "Docker registry to push images to" + default: ghcr.io + registry-password: + description: "Docker registry password" + default: ${{ github.token }} + registry-user: + description: "Docker registry username" + default: ${{ github.actor }} + ros-distro: + description: "ROS Distro (required if ROS is not installed in `base-image`)" + rmw-implementation: + description: "RMW implementation to use (only for ROS 2)" + default: rmw_cyclonedds_cpp + rmw-zenoh-git-ref: + description: "Git ref of rmw_zenoh repo to build if `RMW_IMPLEMENTATION=rmw_zenoh_cpp`" + default: 28d917e0532fed6e9703f044662298f2b3553716 slim-build-args: description: "Arguments to `slim build` (except for `--target` and `--tag`)" default: '--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false' - - enable-singlearch-push: - description: "Enable push of single arch images with [-amd64|-arm64] postfix" - default: false - - enable-push-as-latest: - description: "Push images with tag `latest`/`latest-dev` in addition to the configured image names" - default: false - - enable-checkout: - description: "Enable checkout action to (re-)download your repository prior to running the pipeline" - default: true - - enable-checkout-submodules: - description: "Enable submodules for the checkout action (false|true|recursive)" - default: recursive - - enable-checkout-lfs: - description: "Enable Git LFS support for the checkout action" - default: true + slim-image-name: + description: "Image name of slim run image" + default: ghcr.io/${{ github.repository }} + slim-image-tag: + description: "Image tag of slim run image" + target: + description: "Target stage of Dockerfile (comma-separated list) [dev|run]" + default: run runs: @@ -223,38 +183,38 @@ runs: working-directory: ${{ inputs.build-context }} run: docker/docker-ros/scripts/ci.sh env: - PLATFORM: ${{ inputs.platform }} - TARGET: ${{ inputs.target }} + ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} + ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} + ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} BASE_IMAGE: ${{ inputs.base-image }} + BLACKLISTED_PACKAGES_FILE: ${{ inputs.blacklisted-packages-file }} COMMAND: ${{ inputs.command }} - IMAGE_NAME: ${{ steps.image-name.outputs.lowercase }} - IMAGE_TAG: ${{ inputs.image-tag }} + CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }} DEV_IMAGE_NAME: ${{ steps.dev-image-name.outputs.lowercase }} DEV_IMAGE_TAG: ${{ inputs.dev-image-tag }} - SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }} - SLIM_IMAGE_TAG: ${{ inputs.slim-image-tag }} - ENABLE_SLIM: ${{ inputs.enable-slim }} - SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }} - RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }} - RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }} - ROS_DISTRO: ${{ inputs.ros-distro }} DISABLE_ROS_INSTALLATION: ${{ inputs.disable-ros-installation }} - GIT_HTTPS_SERVER: ${{ inputs.git-https-server }} - GIT_HTTPS_USER: ${{ inputs.git-https-user }} - GIT_HTTPS_PASSWORD: ${{ inputs.git-https-password }} - GIT_SSH_PRIVATE_KEY: ${{ inputs.git-ssh-private-key }} - GIT_SSH_KNOWN_HOST_KEYS: ${{ inputs.git-ssh-known-host-keys }} - ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} ENABLE_RECURSIVE_ADDITIONAL_DEBS: ${{ inputs.enable-recursive-additional-debs }} - ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} - ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }} - BLACKLISTED_PACKAGES_FILE: ${{ inputs.blacklisted-packages-file }} ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: ${{ inputs.enable-recursive-blacklisted-packages }} - CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }} ENABLE_RECURSIVE_CUSTOM_SCRIPT: ${{ inputs.enable-recursive-custom-script }} - VCS_IMPORT_FILE: ${{ inputs.vcs-import-file }} ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }} + ENABLE_SLIM: ${{ inputs.enable-slim }} + GIT_HTTPS_PASSWORD: ${{ inputs.git-https-password }} + GIT_HTTPS_SERVER: ${{ inputs.git-https-server }} + GIT_HTTPS_USER: ${{ inputs.git-https-user }} + GIT_SSH_KNOWN_HOST_KEYS: ${{ inputs.git-ssh-known-host-keys }} + GIT_SSH_PRIVATE_KEY: ${{ inputs.git-ssh-private-key }} + IMAGE_NAME: ${{ steps.image-name.outputs.lowercase }} + IMAGE_TAG: ${{ inputs.image-tag }} + PLATFORM: ${{ inputs.platform }} + RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }} + RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }} + ROS_DISTRO: ${{ inputs.ros-distro }} + SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }} + SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }} + SLIM_IMAGE_TAG: ${{ inputs.slim-image-tag }} + TARGET: ${{ inputs.target }} + VCS_IMPORT_FILE: ${{ inputs.vcs-import-file }} - name: Set up industrial_ci if: ${{ inputs.enable-industrial-ci == 'true' }} @@ -265,15 +225,15 @@ runs: if: ${{ inputs.enable-industrial-ci == 'true' }} uses: ros-industrial/industrial_ci@master env: - UPSTREAM_WORKSPACE: ${{ inputs.build-context }}/.repos - TARGET_WORKSPACE: ${{ inputs.build-context }} ADDITIONAL_DEBS: git AFTER_INIT_EMBED: '[[ "$RMW_IMPLEMENTATION" == "rmw_zenoh_cpp" ]] && export UNDERLAY="/opt/ws_rmw_zenoh/install" ; [[ -n ${{ inputs.git-https-server }} ]] && git config --global url.https://${{ inputs.git-https-user }}:${{ inputs.git-https-password }}@${{ inputs.git-https-server }}.insteadOf https://${{ inputs.git-https-server }}' - SSH_PRIVATE_KEY: ${{ inputs.git-ssh-private-key }} - SSH_SERVER_HOSTKEYS: ${{ inputs.git-ssh-known-host-keys }} - DOCKER_RUN_OPTS: -u root:root DOCKER_IMAGE: ${{ steps.build-images.outputs.INDUSTRIAL_CI_IMAGE }} DOCKER_PULL: false + DOCKER_RUN_OPTS: -u root:root + SSH_PRIVATE_KEY: ${{ inputs.git-ssh-private-key }} + SSH_SERVER_HOSTKEYS: ${{ inputs.git-ssh-known-host-keys }} + TARGET_WORKSPACE: ${{ inputs.build-context }} + UPSTREAM_WORKSPACE: ${{ inputs.build-context }}/.repos - name: Slugify ref name id: slugify-ref-name @@ -286,39 +246,39 @@ runs: working-directory: ${{ inputs.build-context }} run: docker/docker-ros/scripts/ci.sh env: - PLATFORM: ${{ inputs.platform }} - TARGET: ${{ inputs.target }} + ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} + ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} + ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} BASE_IMAGE: ${{ inputs.base-image }} + BLACKLISTED_PACKAGES_FILE: ${{ inputs.blacklisted-packages-file }} COMMAND: ${{ inputs.command }} - IMAGE_NAME: ${{ steps.image-name.outputs.lowercase }} - IMAGE_TAG: ${{ inputs.image-tag }} + CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }} DEV_IMAGE_NAME: ${{ steps.dev-image-name.outputs.lowercase }} DEV_IMAGE_TAG: ${{ inputs.dev-image-tag }} - SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }} - SLIM_IMAGE_TAG: ${{ inputs.slim-image-tag }} - ENABLE_SLIM: ${{ inputs.enable-slim }} - SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }} - ENABLE_SINGLEARCH_PUSH: ${{ inputs.enable-singlearch-push }} - RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }} - RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }} - ROS_DISTRO: ${{ inputs.ros-distro }} DISABLE_ROS_INSTALLATION: ${{ inputs.disable-ros-installation }} - GIT_HTTPS_SERVER: ${{ inputs.git-https-server }} - GIT_HTTPS_USER: ${{ inputs.git-https-user }} - GIT_HTTPS_PASSWORD: ${{ inputs.git-https-password }} - GIT_SSH_PRIVATE_KEY: ${{ inputs.git-ssh-private-key }} - GIT_SSH_KNOWN_HOST_KEYS: ${{ inputs.git-ssh-known-host-keys }} - ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} ENABLE_RECURSIVE_ADDITIONAL_DEBS: ${{ inputs.enable-recursive-additional-debs }} - ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} - ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }} - BLACKLISTED_PACKAGES_FILE: ${{ inputs.blacklisted-packages-file }} ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: ${{ inputs.enable-recursive-blacklisted-packages }} - CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }} ENABLE_RECURSIVE_CUSTOM_SCRIPT: ${{ inputs.enable-recursive-custom-script }} - VCS_IMPORT_FILE: ${{ inputs.vcs-import-file }} ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }} + ENABLE_SINGLEARCH_PUSH: ${{ inputs.enable-singlearch-push }} + ENABLE_SLIM: ${{ inputs.enable-slim }} + GIT_HTTPS_PASSWORD: ${{ inputs.git-https-password }} + GIT_HTTPS_SERVER: ${{ inputs.git-https-server }} + GIT_HTTPS_USER: ${{ inputs.git-https-user }} + GIT_SSH_KNOWN_HOST_KEYS: ${{ inputs.git-ssh-known-host-keys }} + GIT_SSH_PRIVATE_KEY: ${{ inputs.git-ssh-private-key }} + IMAGE_NAME: ${{ steps.image-name.outputs.lowercase }} + IMAGE_TAG: ${{ inputs.image-tag }} + PLATFORM: ${{ inputs.platform }} + RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }} + RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }} + ROS_DISTRO: ${{ inputs.ros-distro }} + SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }} + SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }} + SLIM_IMAGE_TAG: ${{ inputs.slim-image-tag }} + TARGET: ${{ inputs.target }} + VCS_IMPORT_FILE: ${{ inputs.vcs-import-file }} _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) || '' }} @@ -328,38 +288,38 @@ runs: working-directory: ${{ inputs.build-context }} run: docker/docker-ros/scripts/ci.sh env: - PLATFORM: ${{ inputs.platform }} - TARGET: ${{ inputs.target }} + ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} + ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} + ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} BASE_IMAGE: ${{ inputs.base-image }} + BLACKLISTED_PACKAGES_FILE: ${{ inputs.blacklisted-packages-file }} COMMAND: ${{ inputs.command }} - IMAGE_NAME: ${{ steps.image-name.outputs.lowercase }} - IMAGE_TAG: latest + CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }} DEV_IMAGE_NAME: ${{ steps.dev-image-name.outputs.lowercase }} DEV_IMAGE_TAG: latest-dev - SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }} - SLIM_IMAGE_TAG: latest-slim - ENABLE_SLIM: ${{ inputs.enable-slim }} - SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }} - ENABLE_SINGLEARCH_PUSH: ${{ inputs.enable-singlearch-push }} - RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }} - RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }} - ROS_DISTRO: ${{ inputs.ros-distro }} DISABLE_ROS_INSTALLATION: ${{ inputs.disable-ros-installation }} - GIT_HTTPS_SERVER: ${{ inputs.git-https-server }} - GIT_HTTPS_USER: ${{ inputs.git-https-user }} - GIT_HTTPS_PASSWORD: ${{ inputs.git-https-password }} - GIT_SSH_PRIVATE_KEY: ${{ inputs.git-ssh-private-key }} - GIT_SSH_KNOWN_HOST_KEYS: ${{ inputs.git-ssh-known-host-keys }} - ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} ENABLE_RECURSIVE_ADDITIONAL_DEBS: ${{ inputs.enable-recursive-additional-debs }} - ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} - ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }} - BLACKLISTED_PACKAGES_FILE: ${{ inputs.blacklisted-packages-file }} ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: ${{ inputs.enable-recursive-blacklisted-packages }} - CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }} ENABLE_RECURSIVE_CUSTOM_SCRIPT: ${{ inputs.enable-recursive-custom-script }} - VCS_IMPORT_FILE: ${{ inputs.vcs-import-file }} ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }} + ENABLE_SINGLEARCH_PUSH: ${{ inputs.enable-singlearch-push }} + ENABLE_SLIM: ${{ inputs.enable-slim }} + GIT_HTTPS_PASSWORD: ${{ inputs.git-https-password }} + GIT_HTTPS_SERVER: ${{ inputs.git-https-server }} + GIT_HTTPS_USER: ${{ inputs.git-https-user }} + GIT_SSH_KNOWN_HOST_KEYS: ${{ inputs.git-ssh-known-host-keys }} + GIT_SSH_PRIVATE_KEY: ${{ inputs.git-ssh-private-key }} + IMAGE_NAME: ${{ steps.image-name.outputs.lowercase }} + IMAGE_TAG: latest + PLATFORM: ${{ inputs.platform }} + RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }} + RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }} + ROS_DISTRO: ${{ inputs.ros-distro }} + SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }} + SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }} + SLIM_IMAGE_TAG: latest-slim + TARGET: ${{ inputs.target }} + VCS_IMPORT_FILE: ${{ inputs.vcs-import-file }} _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) || '' }} diff --git a/scripts/build.sh b/scripts/build.sh index 4089b60..b0270c8 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -17,26 +17,26 @@ build_image() { $(if [[ "${_ENABLE_IMAGE_PUSH}" == "true" ]]; then echo "--push"; else echo "--load"; fi) \ --build-arg BASE_IMAGE="${BASE_IMAGE}" \ --build-arg COMMAND="${COMMAND}" \ - $(if [[ -n "${RMW_IMPLEMENTATION}" ]]; then echo "--build-arg RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION}"; fi) \ - $(if [[ -n "${RMW_ZENOH_GIT_REF}" ]]; then echo "--build-arg RMW_ZENOH_GIT_REF=${RMW_ZENOH_GIT_REF}"; fi) \ - $(if [[ -n "${ROS_DISTRO}" ]]; then echo "--build-arg ROS_DISTRO=${ROS_DISTRO}"; fi) \ - $(if [[ -n "${DISABLE_ROS_INSTALLATION}" ]]; then echo "--build-arg DISABLE_ROS_INSTALLATION=${DISABLE_ROS_INSTALLATION}"; fi) \ - $(if [[ -n "${GIT_HTTPS_SERVER}" ]]; then echo "--build-arg GIT_HTTPS_SERVER=${GIT_HTTPS_SERVER}"; fi) \ - $(if [[ -n "${GIT_HTTPS_USER}" ]]; then echo "--build-arg GIT_HTTPS_USER=${GIT_HTTPS_USER}"; fi) \ - $(if [[ -n "${GIT_HTTPS_PASSWORD}" ]]; then echo "--build-arg GIT_HTTPS_PASSWORD=${GIT_HTTPS_PASSWORD}"; fi) \ - $(if [[ -n "${GIT_SSH_PRIVATE_KEY}" ]]; then echo "--build-arg GIT_SSH_PRIVATE_KEY=${GIT_SSH_PRIVATE_KEY}"; fi) \ - $(if [[ -n "${GIT_SSH_KNOWN_HOST_KEYS}" ]]; then echo "--build-arg GIT_SSH_KNOWN_HOST_KEYS=${GIT_SSH_KNOWN_HOST_KEYS}"; fi) \ $(if [[ -n "${ADDITIONAL_DEBS_FILE}" ]]; then echo "--build-arg ADDITIONAL_DEBS_FILE=${ADDITIONAL_DEBS_FILE}"; fi) \ - $(if [[ -n "${ENABLE_RECURSIVE_ADDITIONAL_DEBS}" ]]; then echo "--build-arg ENABLE_RECURSIVE_ADDITIONAL_DEBS=${ENABLE_RECURSIVE_ADDITIONAL_DEBS}"; fi) \ $(if [[ -n "${ADDITIONAL_FILES_DIR}" ]]; then echo "--build-arg ADDITIONAL_FILES_DIR=${ADDITIONAL_FILES_DIR}"; fi) \ $(if [[ -n "${ADDITIONAL_PIP_FILE}" ]]; then echo "--build-arg ADDITIONAL_PIP_FILE=${ADDITIONAL_PIP_FILE}"; fi) \ - $(if [[ -n "${ENABLE_RECURSIVE_ADDITIONAL_PIP}" ]]; then echo "--build-arg ENABLE_RECURSIVE_ADDITIONAL_PIP=${ENABLE_RECURSIVE_ADDITIONAL_PIP}"; fi) \ $(if [[ -n "${BLACKLISTED_PACKAGES_FILE}" ]]; then echo "--build-arg BLACKLISTED_PACKAGES_FILE=${BLACKLISTED_PACKAGES_FILE}"; fi) \ - $(if [[ -n "${ENABLE_RECURSIVE_BLACKLISTED_PACKAGES}" ]]; then echo "--build-arg ENABLE_RECURSIVE_BLACKLISTED_PACKAGES=${ENABLE_RECURSIVE_BLACKLISTED_PACKAGES}"; fi) \ $(if [[ -n "${CUSTOM_SCRIPT_FILE}" ]]; then echo "--build-arg CUSTOM_SCRIPT_FILE=${CUSTOM_SCRIPT_FILE}"; fi) \ + $(if [[ -n "${DISABLE_ROS_INSTALLATION}" ]]; then echo "--build-arg DISABLE_ROS_INSTALLATION=${DISABLE_ROS_INSTALLATION}"; fi) \ + $(if [[ -n "${ENABLE_RECURSIVE_ADDITIONAL_DEBS}" ]]; then echo "--build-arg ENABLE_RECURSIVE_ADDITIONAL_DEBS=${ENABLE_RECURSIVE_ADDITIONAL_DEBS}"; fi) \ + $(if [[ -n "${ENABLE_RECURSIVE_ADDITIONAL_PIP}" ]]; then echo "--build-arg ENABLE_RECURSIVE_ADDITIONAL_PIP=${ENABLE_RECURSIVE_ADDITIONAL_PIP}"; fi) \ + $(if [[ -n "${ENABLE_RECURSIVE_BLACKLISTED_PACKAGES}" ]]; then echo "--build-arg ENABLE_RECURSIVE_BLACKLISTED_PACKAGES=${ENABLE_RECURSIVE_BLACKLISTED_PACKAGES}"; fi) \ $(if [[ -n "${ENABLE_RECURSIVE_CUSTOM_SCRIPT}" ]]; then echo "--build-arg ENABLE_RECURSIVE_CUSTOM_SCRIPT=${ENABLE_RECURSIVE_CUSTOM_SCRIPT}"; fi) \ - $(if [[ -n "${VCS_IMPORT_FILE}" ]]; then echo "--build-arg VCS_IMPORT_FILE=${VCS_IMPORT_FILE}"; fi) \ $(if [[ -n "${ENABLE_RECURSIVE_VCS_IMPORT}" ]]; then echo "--build-arg ENABLE_RECURSIVE_VCS_IMPORT=${ENABLE_RECURSIVE_VCS_IMPORT}"; fi) \ + $(if [[ -n "${GIT_HTTPS_PASSWORD}" ]]; then echo "--build-arg GIT_HTTPS_PASSWORD=${GIT_HTTPS_PASSWORD}"; fi) \ + $(if [[ -n "${GIT_HTTPS_SERVER}" ]]; then echo "--build-arg GIT_HTTPS_SERVER=${GIT_HTTPS_SERVER}"; fi) \ + $(if [[ -n "${GIT_HTTPS_USER}" ]]; then echo "--build-arg GIT_HTTPS_USER=${GIT_HTTPS_USER}"; fi) \ + $(if [[ -n "${GIT_SSH_KNOWN_HOST_KEYS}" ]]; then echo "--build-arg GIT_SSH_KNOWN_HOST_KEYS=${GIT_SSH_KNOWN_HOST_KEYS}"; fi) \ + $(if [[ -n "${GIT_SSH_PRIVATE_KEY}" ]]; then echo "--build-arg GIT_SSH_PRIVATE_KEY=${GIT_SSH_PRIVATE_KEY}"; fi) \ + $(if [[ -n "${RMW_IMPLEMENTATION}" ]]; then echo "--build-arg RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION}"; fi) \ + $(if [[ -n "${RMW_ZENOH_GIT_REF}" ]]; then echo "--build-arg RMW_ZENOH_GIT_REF=${RMW_ZENOH_GIT_REF}"; fi) \ + $(if [[ -n "${ROS_DISTRO}" ]]; then echo "--build-arg ROS_DISTRO=${ROS_DISTRO}"; fi) \ + $(if [[ -n "${VCS_IMPORT_FILE}" ]]; then echo "--build-arg VCS_IMPORT_FILE=${VCS_IMPORT_FILE}"; fi) \ . echo "Successfully built stage '${TARGET}' for platform '${PLATFORM}' as '${IMAGE}'" } diff --git a/scripts/ci.sh b/scripts/ci.sh index 6d0bf51..0dc312a 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -19,32 +19,32 @@ DEV_IMAGE_TAG="${DEV_IMAGE_TAG:-${IMAGE_TAG}-dev}" SLIM_IMAGE_NAME="${SLIM_IMAGE_NAME:-${IMAGE_NAME}}" SLIM_IMAGE_TAG="${SLIM_IMAGE_TAG:-${IMAGE_TAG}-slim}" -IMAGE="${IMAGE_NAME}:${IMAGE_TAG}" -DEV_IMAGE="${DEV_IMAGE_NAME}:${DEV_IMAGE_TAG}" -SLIM_IMAGE="${SLIM_IMAGE_NAME}:${SLIM_IMAGE_TAG}" -ENABLE_SLIM="${ENABLE_SLIM:-true}" -SLIM_BUILD_ARGS="${SLIM_BUILD_ARGS:-'--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false'}" -ENABLE_SINGLEARCH_PUSH="${ENABLE_SINGLEARCH_PUSH:-false}" -RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-}" -RMW_ZENOH_GIT_REF="${RMW_ZENOH_GIT_REF:-}" -ROS_DISTRO="${ROS_DISTRO:-}" -DISABLE_ROS_INSTALLATION="${DISABLE_ROS_INSTALLATION:-}" -GIT_HTTPS_SERVER="${GIT_HTTPS_SERVER:-}" -GIT_HTTPS_USER="${GIT_HTTPS_USER:-}" -GIT_HTTPS_PASSWORD="${GIT_HTTPS_PASSWORD:-}" -GIT_SSH_PRIVATE_KEY="${GIT_SSH_PRIVATE_KEY:-}" -GIT_SSH_KNOWN_HOST_KEYS="${GIT_SSH_KNOWN_HOST_KEYS:-}" ADDITIONAL_DEBS_FILE="${ADDITIONAL_DEBS_FILE:-}" -ENABLE_RECURSIVE_ADDITIONAL_DEBS="${ENABLE_RECURSIVE_ADDITIONAL_DEBS:-}" ADDITIONAL_FILES_DIR="${ADDITIONAL_FILES_DIR:-}" ADDITIONAL_PIP_FILE="${ADDITIONAL_PIP_FILE:-}" -ENABLE_RECURSIVE_ADDITIONAL_PIP="${ENABLE_RECURSIVE_ADDITIONAL_PIP:-}" BLACKLISTED_PACKAGES_FILE="${BLACKLISTED_PACKAGES_FILE:-}" -ENABLE_RECURSIVE_BLACKLISTED_PACKAGES="${ENABLE_RECURSIVE_BLACKLISTED_PACKAGES:-}" CUSTOM_SCRIPT_FILE="${CUSTOM_SCRIPT_FILE:-}" +DEV_IMAGE="${DEV_IMAGE_NAME}:${DEV_IMAGE_TAG}" +DISABLE_ROS_INSTALLATION="${DISABLE_ROS_INSTALLATION:-}" +ENABLE_RECURSIVE_ADDITIONAL_DEBS="${ENABLE_RECURSIVE_ADDITIONAL_DEBS:-}" +ENABLE_RECURSIVE_ADDITIONAL_PIP="${ENABLE_RECURSIVE_ADDITIONAL_PIP:-}" +ENABLE_RECURSIVE_BLACKLISTED_PACKAGES="${ENABLE_RECURSIVE_BLACKLISTED_PACKAGES:-}" ENABLE_RECURSIVE_CUSTOM_SCRIPT="${ENABLE_RECURSIVE_CUSTOM_SCRIPT:-}" -VCS_IMPORT_FILE="${VCS_IMPORT_FILE:-}" ENABLE_RECURSIVE_VCS_IMPORT="${ENABLE_RECURSIVE_VCS_IMPORT:-}" +ENABLE_SINGLEARCH_PUSH="${ENABLE_SINGLEARCH_PUSH:-false}" +ENABLE_SLIM="${ENABLE_SLIM:-true}" +GIT_HTTPS_PASSWORD="${GIT_HTTPS_PASSWORD:-}" +GIT_HTTPS_SERVER="${GIT_HTTPS_SERVER:-}" +GIT_HTTPS_USER="${GIT_HTTPS_USER:-}" +GIT_SSH_KNOWN_HOST_KEYS="${GIT_SSH_KNOWN_HOST_KEYS:-}" +GIT_SSH_PRIVATE_KEY="${GIT_SSH_PRIVATE_KEY:-}" +IMAGE="${IMAGE_NAME}:${IMAGE_TAG}" +RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-}" +RMW_ZENOH_GIT_REF="${RMW_ZENOH_GIT_REF:-}" +ROS_DISTRO="${ROS_DISTRO:-}" +SLIM_BUILD_ARGS="${SLIM_BUILD_ARGS:-'--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false'}" +SLIM_IMAGE="${SLIM_IMAGE_NAME}:${SLIM_IMAGE_TAG}" +VCS_IMPORT_FILE="${VCS_IMPORT_FILE:-}" _ENABLE_IMAGE_PUSH="${_ENABLE_IMAGE_PUSH:-false}" _IMAGE_POSTFIX="${_IMAGE_POSTFIX:-""}"