弹性魔豆与.ebextensions运行`NPM install`"/>
如何在Amazon弹性魔豆与.ebextensions运行`NPM install`
我想与eb deploy
命令部署在亚马逊弹性魔豆我的PHP应用程序。但是我的应用程序使用一饮而尽到Concat的,然后再缩小SCSS和JS。
所以,我在文件.ebextensios/03npm.config
尝试这些命令
commands:
01-install-node:
command: "yum install nodejs npm --enablerepo=epel -y"
container_commands:
01-install-dependencies:
command: "npm install"
02-build:
command: "npm run build"
但最后我收到此错误
[Instance: i-c7800103] Command failed on instance. Return code: 1 Output: (TRUNCATED)...ttps://registry.npmjs/acorn npm http 304 npm http 304 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /var/app/ondeck/npm-debug.log npm ERR! not ok code 0. container_command 01-install-dependencies in .ebextensions/03npm.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
我不知道,但似乎npm install
从一个包,可以忽略不计,但它正在调度EB错误,并停止整个过程中收到错误。
我用这台机器上运行:64bit Amazon Linux 2015.09 v2.0.4 running PHP 5.6
有谁知道我们如何解决这一问题?
回答如下:到现在为止,我有这个丑陋的解决方案,但它的工作原理。我创建了里面的package.json是做艰苦的工作顺序此脚本。它创建一个新的分支,前提交编译的文件部署到EB
的package.json
{
"scripts": {
"production": "node ./node_modules/gulp/bin/gulp.js --production",
"deploy": "git checkout -b deploy && npm run production && git add . && git commit -m \"build\" && eb deploy && git checkout master && git branch -D deploy"
}
}
.elasticbeanstalk / config.yml
branch-defaults:
deploy:
environment: NAME_OF_ENVIRONMENT
更多推荐
如何在Amazon弹性魔豆与.ebextensions运行`NPM install`
发布评论