How to combine one terminal command in Concourse task run config

252 Views Asked by At

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
1

There are 1 best solutions below

0
On BEST ANSWER

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