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

step does not fail #3470

Open
AlexanderZvyagin opened this issue Feb 4, 2024 · 1 comment
Open

step does not fail #3470

AlexanderZvyagin opened this issue Feb 4, 2024 · 1 comment
Labels
bug Gitness pipelines everything related to pipelines

Comments

@AlexanderZvyagin
Copy link

I have two steps. In both steps I am trying to access a file which does not exist. Both steps should fail, but one succeeded. The workaround is to use script: |- syntax.

kind: pipeline
spec:
  stages:
  - name: build
    spec:
      platform:
        arch: amd64
        os: linux
      steps:
      - spec:
          container:
            image: alpine:3
          script:
          - echo hi
          - cat /random-file
        type: run
        name: itworks
      - spec:
          container:
            image: alpine:3
          script:
          - cat /random-file
        type: run
        name: itfails
    type: ci
version: 1

Output:

clone
Cloning with 0 retries Initialized empty Git repository in /gitness/.git/ + git fetch origin +refs/heads/main: From http://host.docker.internal:3000/git/Test/TestRepo * branch main -> FETCH_HEAD * [new branch] main -> origin/main + git checkout a6d70fb2f91881478ee2a11a42d2c2cd4c790609 -b main Switched to a new branch 'main'

itworks
+ echo hi hi

itfails
+ cat /random-file cat: can't open '/random-file': No such file or directory 
@jimsheldon jimsheldon added the bug label Apr 11, 2024
@jimsheldon
Copy link
Contributor

Thanks for reporting this bug, script should support either a string or an array.

@johannesHarness johannesHarness added Gitness pipelines everything related to pipelines labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Gitness pipelines everything related to pipelines
Projects
None yet
Development

No branches or pull requests

3 participants