concourse / concourse-pipeline-resource

!!! use the `set_pipeline` step instead !!!
https://concourse-ci.org/jobs.html#schema.step.set-pipeline-step.set_pipeline
MIT License
76 stars 42 forks source link

Print output of set pipeline. #56

Closed aledegano closed 5 years ago

aledegano commented 5 years ago

Fix #37.

Print the output of the set-pipeline command to improve visibility of the change performed by the resource.

Signed-off-by: Alessandro Degano alessandro.degano@pix4d.com

I have few questions about this attempt I've made:

  1. The solution I'm proposing "pollutes" the output of the tests (although they still return successfully), is it possible to avoid that? I tried returning the output to the "command" but seems a bit complex...

  2. The colors of the output of set-pipeline are rendered correctly but each line still begins with  which seems an escape sequence not correctly parsed, any idea where this comes from?

marco-m commented 5 years ago

@aledeganopix4d could you please add here the actual output you showed me? I think this will make is easier the task of the reviewers :-)

aledegano commented 5 years ago

This is an output example when successfully setting a new pipeline:

Logging to /tmp/concourse-pipeline-resource-out.log902023305
Set for pipeline: hello-world.
 Output: 
 jobs:
  job leak has been added:
  + name: leak
  + plan:
  + - task: leak
  +   config:
  +     platform: linux
  +     image_resource:
  +       type: docker-image
  +       source:
  +         repository: alpine
  +     run:
  +       path: sh
  +       args:
  +       - -c
  +       - |
  +         while true; do echo "Hello, world!"; sleep 5; done

pipeline created!
you can view your pipeline here: https://builder.ci.pix4d.com/teams/developers/pipelines/hello-world

the pipeline is currently paused. to unpause, either:
  - run the unpause-pipeline command:
    fly -t https://builder.ci.pix4d.com unpause-pipeline -p hello-world
  - click play next to the pipeline in the web ui

And this is an output example for a pipeline with an error:

Logging to /tmp/concourse-pipeline-resource-out.log334129886
Set for pipeline: hello-world.
 Output: 
 jobs:
  job leak has changed:
  name: leak
  plan:
  + - get: non-existing-resource.git
  - task: leak
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: alpine
      run:
        path: sh
        args:
        - -c
        - |
          while true; do echo "Hello, world!"; sleep 5; done

2019/04/29 09:43:02 exit status 1 - error: invalid pipeline config:
invalid jobs:
    jobs.leak.plan[0].get.non-existing-resource.git refers to a resource that does not exist