1

This is my first question so please presume ignorance and positive intent.

As part of our build pipeline I need to run what our dev team calls "unit tests." These unit tests are run via an ant target. Before running that ant target we must spin up, configure and partially populate (the ant target does some of the population) several containers including:

  • application server
  • ldap instance
  • postgres instance

It looks as if each task only supports a single container. Is there a straightforward way to get all of these running together? Ideally I could create a task that would allow me to specify a pod template with the commands running in one of the containers of that pod.

I realize that I could hack this together by using the openshift client or kubernetes actions but I was hoping for something a bit more elegant. I feel like using either of those tasks would require that I build out status awareness, error checking, retry logic, etc that is likely already part of the pipeline logic and then parse the output of the ant run to determine if all of the tests were successful. This is my first foray into tekton so accepted patterns or idioms would be greatly appreciated.

For greater context I see these tasks making up my pipeline:

  • clone git repo
  • build application into intermediate image
  • launch pod with all necessary containers
  • wait for all containers to become "ready"
  • execute ant target to run unit tests
  • if all tests pass build runtime image
  • copy artifacts from runtime image to external storage (for deployment outside of openshift)

Thank you for your time

1 Answers1

0

Have a look at sidecars. The database must be up and running for the tests to execute, so start the database in a sidecar. The steps in the task will be started as soon as all sidecars are running.

Donat
  • 4,157
  • 3
  • 11
  • 26