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

Issue with put step tutorial #532

Open
ismail-temiz opened this issue Mar 12, 2024 · 1 comment
Open

Issue with put step tutorial #532

ismail-temiz opened this issue Mar 12, 2024 · 1 comment
Labels

Comments

@ismail-temiz
Copy link

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: [email protected]: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: [email protected]
          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

@taylorsilva
Copy link
Member

Good point! Probably causes more confusion than anything else.

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

No branches or pull requests

2 participants