testcontainers / dind-drone-plugin

Plugin for Drone CI v0.8+ to enable use of Testcontainers using Docker-in-Docker
Apache License 2.0
31 stars 19 forks source link

Add image_aliases and hook script support #9

Closed rnorth closed 4 years ago

rnorth commented 4 years ago

This is intended to provide a crude solution to https://github.com/testcontainers/testcontainers-java/issues/3099 for teams using Drone CI.

It allows users to specify a set of images that should be pulled and retagged, and exposes a hook script mechanism so that more custom implementations can be developed.

Note that I believe https://github.com/testcontainers/testcontainers-java/pull/3102 is by far the better solution, but I believe this provides another option for Drone users who cannot use that approach.

Example usage from README:

pipeline:
  build:
    image: quay.io/testcontainers/dind-drone-plugin
    build_image: openjdk:8-jdk-alpine
    cmd: ./gradlew clean check --info

    # Not mandatory; sets up image name 'aliases' by pulling from one registry and tagging
    #  as a different name. Intended as a simplistic mechanism for using a private registry 
    #  rather than Docker Hub for a known set of images. Accepts a dictionary of
    #  private registry image name to the Docker Hub image that it is a substitute for.
    #  Note that all images are pulled synchronously before the build starts, so this is
    #  inefficient if any unnecessary images are listed.
    image_aliases:
      someregistry.com/redis:4.0.6: redis:4.0.6
rnorth commented 4 years ago

Thanks @gjtempleton