4

I basically want to run the npm install and grunt build command within the newly added repo.

        inputs:
          - name: repo

          - path:
        run:
          path: repo/
          args:
          - npm install
          - grunt build
Atlantic0
  • 3,271
  • 5
  • 17
  • 24

2 Answers2

15

path: refers to the path in the container to the binary / script to execute.

Check out this example on the Tasks documentation here : https://concourse-ci.org/tasks.html#task-environment

run:
  path: sh
  args:
  - -exc
  - |
    whoami
    env

sh is the program to execute, and args are passed to the sh program

Steve Chambers
  • 37,270
  • 24
  • 156
  • 208
Topher Bullock
  • 262
  • 2
  • 8
  • how do you run this within "do" ? ```on_failure: do: - run: path: sh args: - -exc - | whoami env``` doesn't validate for example. I guess my syntax is wrong somehow. – trainoasis Dec 06 '22 at 14:19
0

slight variation of Topher Bullock's answer

run:
  path: sh
  args:
  - -exc
  - whoami && env

which will run env if only whoami doesn't return error

This will run env even if whoami fails.

run:
  path: sh
  args:
  - -exc
  - whoami || env

sjwl
  • 1