concourseconcourse-task

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

Solution

  • 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