2015-04-07 3 views
3

Я использую beanstalk для развертывания на aws ec2. Мой проект использует беседу для управления зависимостью библиотек. (Но основным языком моего проекта является python-flask.)bower install with beanstalk

Как я знаю, я могу установить другие пакеты по конфигурации .ebextensions. Я установил redis с ним.

packages: 
    yum: 
    gcc-c++: [] 
    make: [] 
sources: 
    /home/ec2-user: http://download.redis.io/releases/redis-2.8.4.tar.gz 
commands: 
    redis_build: 
    command: make 
    cwd: /home/ec2-user/redis-2.8.4 
    redis_config_001: 
    command: sed -i -e "s/daemonize no/daemonize yes/" redis.conf 
    cwd: /home/ec2-user/redis-2.8.4 
    redis_config_002: 
    command: sed -i -e "s/# maxmemory <bytes>/maxmemory 500MB/" redis.conf 
    cwd: /home/ec2-user/redis-2.8.4 
    redis_config_003: 
    command: sed -i -e "s/# maxmemory-policy volatile-lru/maxmemory-policy allkeys-lru/" redis.conf 
    cwd: /home/ec2-user/redis-2.8.4 
    redis_server: 
    command: src/redis-server redis].conf 
    cwd: /home/ec2-user/redis-2.8.4 

Я добавил npm и bower, но он не работает.

packages: 
    yum: 
    gcc-c++: [] 
    make: [] 
sources: 
    /home/ec2-user: http://download.redis.io/releases/redis-2.8.4.tar.gz 
commands: 
    redis_build: 
    command: make 
    cwd: /home/ec2-user/redis-2.8.4 
    redis_config_001: 
    command: sed -i -e "s/daemonize no/daemonize yes/" redis.conf 
    cwd: /home/ec2-user/redis-2.8.4 
    redis_config_002: 
    command: sed -i -e "s/# maxmemory <bytes>/maxmemory 500MB/" redis.conf 
    cwd: /home/ec2-user/redis-2.8.4 
    redis_config_003: 
    command: sed -i -e "s/# maxmemory-policy volatile-lru/maxmemory-policy allkeys-lru/" redis.conf 
    cwd: /home/ec2-user/redis-2.8.4 
    redis_server: 
    command: src/redis-server redis].conf 
    cwd: /home/ec2-user/redis-2.8.4 
    npm_install: 
    command: "yum install -y npm" 
    bower_install: 
    command: "npm install -g bower" 
    bower_install_packages: 
    command: bower install 

Я всегда сталкиваюсь с такой ошибкой.

Upload Complete. 
INFO: Environment update is starting.        
INFO: Deploying new version to instance(s).       
ERROR: [Instance: i-41397fb2 Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: [CMD-AppDeploy/AppDeployStage0/EbExtensionPreBuild] command failed with error code 1: Error occurred during build: Command bower_install failed. 
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1]. 

Как я могу решить эту проблему?

+0

Ищет то же самое! Вы нашли решение? – theChinmay

+0

@ theChinmay https://gist.github.com/growingdever/8eb2ae8e5793b9c1cd09 попытайтесь использовать это. –

ответ

4

https://gist.github.com/growingdever/8eb2ae8e5793b9c1cd09

Я решить эту проблему выше конфигурации. (эта конфигурация была написана мной.)

+1

Ссылка отсутствует :-( – Patrick

+0

@Patrick попробуйте этот. Https://gist.github.com/toughrogrammer/8eb2ae8e5793b9c1cd09 –

1

У меня тоже была эта проблема, и, наконец, поддержка AWS разрешила это для меня. Разрешение:

1) Добавьте следующий скрипт .ebestensions:

container_commands: 
    01_bower_install: 
    command: "export PATH=$PATH; $NODE_HOME/bin/node ./node_modules/bowe/bin/bower -V install --allow-root -F > /tmp/01_bower_install.log" 

2) Добавьте следующую строку в package.json (в сценарии элемента)

"scripts": { 
    "postInstall": "bower install" 
}, 

Это все

Смежные вопросы