There is no way when executing commands in elastic beanstalk container_commands

I am trying to deploy an application on AWS Elastic Beanstalk. I have the following file in .ebextensions:

commands:
  01-install-git:
    command: "yum install -y git &>> /tmp/deploy.log"
  02-install-nodejs-npm:
    command: "yum install -y --enablerepo=epel nodejs npm &>> /tmp/deploy.log"
  03-install-grunt:
    command: "npm install -g grunt-cli &>> /tmp/deploy.log"
  04-install-coffee:
    command: "npm install -g coffee-script &>> /tmp/deploy.log"
  05-install-bower:
    command: "npm install -g bower &>> /tmp/deploy.log"
container_commands:
  01_grunt:
    command: "export PATH=/usr/local/bin:/bin:/usr/bin; grunt prod &>> /tmp/deploy.log"

Basically, I want to run grunt prod, and this will load the bower dependencies, compile my coffeescript, minify / concat my js and some other things. The git, nodejs, grunt, coffee and bower settings work fine (I can ssh and confirm that the commands are available on the way). However, if I do not turn on the part export PATH=/usr/local/bin:/bin:/usr/bin;when invoking the gazebo, I get:

Running "bower:install" (bower) task
Fatal error: git is not installed or not in the PATH

I tried to debug and add which git &>> /tmp/deploy.log, but received which: no git in ((null)). However, if I do echo $PATH &>> /tmp/deploy.log, I get a good way:/usr/local/bin:/bin:/usr/bin

Question: Why should I indicate the path when invoking the conversation?

+4
2

, , PATH , . export PATH=$PATH; grunt:

container_commands:
  01_grunt:
    command: "export PATH=$PATH; grunt prod &>> /tmp/deploy.log"
+7

, PATH=$PATH command:.

...

container_commands:
  01_path:
    command: "export PATH=$PATH; echo $PATH &>> /tmp/01_path.log"
    ignoreErrors: true
  02_bower_install:
    command: "$NODE_HOME/bin/node ./node_modules/bower/bin/bower install --allow-root &>> /tmp/02_bower_install.log"
    ignoreErrors: true

...

bower    no-home HOME environment variable not set. User config will not be loaded.
ENOGIT git is not installed or not in the PATH

NB: container_command root, bower install --allow-root

0

All Articles