Amazon web services 使用gulp部署到elastic beanstalk-静态文件权限问题
最近,我不得不从使用Amazon web services 使用gulp部署到elastic beanstalk-静态文件权限问题,amazon-web-services,deployment,gulp,amazon-elastic-beanstalk,Amazon Web Services,Deployment,Gulp,Amazon Elastic Beanstalk,最近,我不得不从使用eb deploy改为使用gulp任务将我的项目部署到AWS elastic beanstalk 原因是我需要将ES6文件转换为ES5。我不想将转换后的文件提交到我们的git中,eb deploy使用git archive命令来进行zip部署 转换和部署工作正常,我遇到了静态文件的问题 gulp.task('ebDeploy', function() { return gulp.src([ './.ebextensions/**',
eb deploy
改为使用gulp任务将我的项目部署到AWS elastic beanstalk
原因是我需要将ES6文件转换为ES5。我不想将转换后的文件提交到我们的git中,eb deploy
使用git archive命令来进行zip部署
转换和部署工作正常,我遇到了静态文件的问题
gulp.task('ebDeploy', function() {
return gulp.src([
'./.ebextensions/**', // Include the .ebextensions folder
'./**/*.js', // Match all .js files
'!./es6/**/*', // Exclude files in /es6 dir
'!node_modules', '!node_modules/**', // Exclude the node_modules folder and contained files
'*.js', // Include JS Files in the base dir
'package.json', // Include this specific file in base dir
'./config/**', // Include everything under /config
'./public/**', './public/**/*', // Include everything under /public
'./views/**/*.ejs' // Include all .ejs files under /views
], { base: './' })
.pipe(print())
.pipe(gulpEbDeploy({
//name: 'my-application', // optional: If not set, the name from package.json will be used
//version: '1.0.0', // optional: If not set, the version from package.json will be used
timestamp: true, // optional: If set to false, the zip will not have a timestamp
waitForDeploy: true, // optional: if set to false the task will end as soon as it starts deploying
amazon: {
// accessKeyId: "< your access key (fyi, the 'short' one) >", // optional
// secretAccessKey: "< your secret access key (fyi, the 'long' one) >", // optional
// signatureVersion: "v4", // optional
region: 'eu-west-2',
bucket: 'elasticbeanstalk',
applicationName: 'foo',
environmentName: 'bar'
}
}))
});
06:49:28.81 server.js:98 | Global Error Handler
06:49:28.81 server.js:99 | { Error: EACCES: permission denied, stat '/var/app/current/public/css/default.css'
at Error (native)
errno: -13,
code: 'EACCES',
syscall: 'stat',
path: '/var/app/current/public/css/default.css',
expose: false,
statusCode: 500,
status: 500 }
要使这些文件按预期工作,我需要做什么 是权限-EB部署作为根AFAIK运行。从何处调用gulp任务?我还认为这类任务属于ci服务器。您可以让您的ci服务器执行您喜欢的所有处理,并准备一个EB部署包。这也将加快您的部署。我正在本地开发机器上运行它,目前没有资源来设置ci服务器。我的意思是,您如何在EC2实例上调用gulp任务来获得该错误?我正在从本地机器上调用gulp任务,它将部署到EC2,但是,我在浏览实时部署的站点时遇到了权限问题。