0

Is there a way to retrieve the build artefacts from a s2i build, so I can send it along to SonarQube in a pipeline?

Just trying to simplify a pipeline as to not build twice. SonarQube code quality for Java requires the jars to be sent but s2i seems to only have these artefacts on the docker image, not the building host which makes sense.

Here is the reference tekton task:

https://github.com/openshift/tektoncd-pipeline-operator/blob/master/deploy/resources/addons/02-clustertasks/s2i-java-11-pr/s2i-java-11-pr-task.yaml

Here is a snippet from the above where the s2i takes place:

command:
    - 's2i'
    - 'build'
    - '$(params.PATH_CONTEXT)'
    - 'registry.access.redhat.com/openjdk/openjdk-11-rhel7'
    - '--image-scripts-url'
    - 'image:///usr/local/s2i'
    - '--as-dockerfile'
    - '/gen-source/Dockerfile.gen'
    - '--environment-file'
    - '/env-params/env-file'

And finally here is our full pipeline for reference, the circled items both do a maven build, the one on top only builds so SonarQube has access to the jar:

Tekton pipeline

TedEllis
  • 66
  • 6

0 Answers0