Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues running build pipeline #4

Open
gbengataylor opened this issue Oct 29, 2019 · 0 comments
Open

Issues running build pipeline #4

gbengataylor opened this issue Oct 29, 2019 · 0 comments

Comments

@gbengataylor
Copy link

gbengataylor commented Oct 29, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant