Templated build step

Long time user, first time poster.
Anyone got an examples/ideas of how to template drone build steps?
I’ve got a bunch of repos that are all similar looking modules that I want to run a linter, test runner, and other generic steps over, but would rather not maintain all those steps in each repo’s .drone.yml and instead just depend on a single ‘run my tests’.
initial thoughts are is making a docker container with dind + drone and do a drone exec.

implementation wise would like to have something like:

    image: mytestsuite
    tests: /tests/*._py

and have it magically do the equivalent of:

    image: hashicorp/terraform
    commands: terraform fmt --diff --check

    image: wata727/tflint
    commands: tflint ${pwd}
    image: quay.io/ukhomeofficedigital/tf-testrunner
    commands: python -m unittest tests/*_test.py

would appreciate thoughts and ideas!

1 Like

for the minute have built:

But would be great to have something less gross and even better if I could separate the build steps in the output