fly.bird
fly.bird

Reputation: 131

How to combine one terminal command in Concourse task run config

How shall I combine one terminal command in Concourse task

command I use on terminal

export ENVIRONMENT=development NODE_ENV=local; mvn clean install

How to use this in Concourse run config? Are below lines correct?

run:
            path: /usr/bin/mvn
            dir: pr
            args:
              - -exc
              - |
              - export
                  ENVIRONMENT = development
                  NODE_ENV= local
              - clean 
              - install

Upvotes: 1

Views: 268

Answers (1)

franklinsijo
franklinsijo

Reputation: 18270

You can directly run the command as a shell command

run:
   path: /bin/sh
   dir: pr
   args:
    - -exc
    - |
      export ENVIRONMENT=development NODE_ENV=local
      mvn clean install

Else, the variables being exported must be set under params in task config before run

params:
  ENVIRONMENT: development
  NODE_ENV: local
run:
  path: /usr/bin/mvn
  dir: pr
  args: 
   - clean
   - install

Upvotes: 1

Related Questions