pipelines-examples
pipelines-examples copied to clipboard
Issues running build pipeline
When the build-image task is run it fails because it can't find the Dockerfile in the copied source directory created by the build-app task. It seems by default (https://github.com/tektoncd/pipeline/blob/master/docs/tasks.md#outputs) the output is always in /workspace/output/source but when the git repo was cloned it was copied to / and that is the working directory
I modified the mvn-build task to clone to /workspace/output/source and run the maven build using that location as the working directory. Another workaround could have been to add a step to copy the directory
I also had to add an empty volume to get pass an "/.m2 doesn't exist" error
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: mvn-build
spec:
inputs:
resources:
- name: source
targetPath: output/source
type: git
outputs:
resources:
- name: source
type: git
steps:
- args:
- verify
command:
- /usr/bin/mvn
image: 'maven:3.6.0-jdk-8-slim'
name: build
resources: {}
volumeMounts:
- mountPath: /.m2
name: m2-repository
workingDir: /workspace/output/source
volumes:
- emptyDir: {}
name: m2-repository
I can create a PR if you wish