apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
  name: tutorial-pipeline
spec:
  resources:
    - name: source-repo
      type: git
    - name: web-image
      type: image
  tasks:
    - name: build-skaffold-web
      taskRef:
        name: build-docker-image-from-git-source
      params:
        - name: pathToDockerFile
          value: Dockerfile
        - name: pathToContext
          value: /workspace/docker-source/examples/microservices/leeroy-web #configure: may change according to your source
      resources:
        inputs:
          - name: docker-source
            resource: source-repo
        outputs:
          - name: builtImage
            resource: web-image
    - name: deploy-web
      taskRef:
        name: deploy-using-kubectl
      resources:
        inputs:
          - name: source
            resource: source-repo
          - name: image
            resource: web-image
            from:
              - build-skaffold-web
      params:
        - name: path
          value: /workspace/source/examples/microservices/leeroy-web/kubernetes/deployment.yaml #configure: may change according to your source
        - name: yamlPathToImage
          value: "spec.template.spec.containers[0].image"
---
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
  name: simple-pipeline
spec:
  tasks:
    - name: push
      taskRef:
        name: echo-hello-world
    - name: build-1
      taskRef:
        name: echo-hello-world
      runAfter:
        - push
    - name: build-2
      taskRef:
        name: echo-hello-world
      runAfter:
        - push
    - name: deploy
      taskRef:
        name: echo-hello-world
      runAfter:
        - build-2
    - name: test-1
      taskRef:
        name: echo-hello-world
      runAfter:
        - deploy
    - name: test-2
      taskRef:
        name: echo-hello-world
      runAfter:
        - deploy
---
