Atlantic0
Atlantic0

Reputation: 3571

How can I run a small command in a concourse pipeline?

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

Upvotes: 4

Views: 13441

Answers (2)

Topher Bullock
Topher Bullock

Reputation: 262

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

Upvotes: 15

sjwl
sjwl

Reputation: 1

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

Upvotes: 0

Related Questions