在 towerjs 中将生产资产上传到 S3 的正确方法是什么?我在 config/credentials.coffee 中配置了我的 S3 凭据
然后我尝试蛋糕资产:发布
并得到
/Users/avaranovich/projects/demos/node/firstApp/Cakefile:15
client = knox.createClient(Tower.secrets.s3);
^
TypeError: Cannot read property 's3' of undefined
at Object._this [as action] (/Users/avaranovich/projects/demos/node/firstApp/Cakefile:15:45)
at helpers.extend.invoke (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:42:26)
at Object.action (/Users/avaranovich/projects/demos/node/firstApp/Cakefile:9:12)
at helpers.extend.invoke (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:42:26)
at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:67:21)
at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/cake:7:38)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
更新:我发现任务assets:upload:s3中的正确行应该看起来 client = knox.createClient Tower.config.credentials.s3
但后来我得到另一个错误
/Users/avaranovich/projects/demos/node/firstApp/node_modules/tower/lib/tower/server/application/assets.js:112
_console.debug("Uploading to " + Tower.secrets.s3.bucket);
^
TypeError: Cannot read property 's3' of undefined
at Object.Tower.Application.Assets.upload (/Users/avaranovich/projects/demos/node/firstApp/node_modules/tower/lib/tower/server/application/assets.js:112:51)
at Object._this [as action] (/Users/avaranovich/projects/demos/node/firstApp/Cakefile:16:37)
似乎 Tower.secrets.s3.bucket 在其他地方硬编码。
谢谢,安德烈