harness / gitness

Gitness is an Open Source developer platform with Source Control management, Continuous Integration and Continuous Delivery.
https://gitness.com
Apache License 2.0
31.96k stars 2.79k forks source link

step does not fail #3470

Open AlexanderZvyagin opened 5 months ago

AlexanderZvyagin commented 5 months ago

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 commented 3 months ago

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