Skip to content

Issue with put step tutorial #532

Open
@ismail-temiz

Description

@ismail-temiz

Describe the bug

As I was going through the tutorial, I discovered a bug or more like an unnecessary key which could confuse new-learners.
In lit/docs/getting-started/resources.lit There is a tutorial config that teaches about put step

  resources:
  - name: repo
    type: git
    source:
      uri: git@github.com:concourse/examples.git
      branch: master
      private_key: |
        -----BEGIN OPENSSH PRIVATE KEY-----
        ...
        -----END OPENSSH PRIVATE KEY-----

  jobs:
  - name: hello-world-job
    plan:
    - get: repo
      trigger: true
    - task: create-commit
      config:
        platform: linux
        image_resource:
          type: registry-image
          source:
            repository: gitea/gitea
        inputs:
        - name: repo
        outputs:
        - name: repo
        params:
          EMAIL: person@example.com
          GIT_AUTHOR_NAME: Person Doe
        run:
          path: sh
          args:
          - -cx
          - |
            cd repo
            date +%Y-%m-%d > todays-date
            git add ./todays-date
            git config --global user.email $EMAIL
            git config --global user.name $GIT_AUTHOR_NAME
            git commit -m "Update todays date"
    - put: repo
      params:
        repository: repo

the get step has trigger set true which is why this pipeline would normally trigger and run indefinitely but because it is trying to add something that it has already done in the first run, it fails with nothing to commit, working tree clean in the second run.

I don't think trigger is required here.

Reproduction steps

  1. Create a concourse pipeline definition with above code
  2. Set the pipeline
  3. Trigger the pipeline.
    ...

Expected behavior

trigger removed or set to false

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions