【发布时间】:2017-04-19 17:16:04
【问题描述】:
这里的 gulp-octo 版本是 0.0.10,不再是当前版本。这可能适用于也可能不适用于较新的版本
angular-cli 命令ng-build 将我的 Angular 应用程序构建到 /dist 文件夹中。
我最终得到一个平面 dist 文件夹,其中包含我的 js、html 等文件。
/dist
index.html
inline.js
[etc]
然后我可以使用gulp-octo 将我的包发布到我的章鱼部署主机,如下所示:
// You need to bump version in package.json and ng build before running this
gulp.task("publish", function() {
return gulp.src(["dist/**"])
.pipe(octo.pack())
.pipe(octo.push(octoConfig));
});
哪个有效。
然后我将文件assetFile.png 添加到资产文件中。这会改变 /dist 的外观。它不再是完全平坦的:
/dist
/assets
assetFile.png
index.html
inline.js
[etc]
突然之间,gulp publish 因以下错误而失败:
λ gulp publish
[11:14:58] Using gulpfile C:\Source\blank-angular-cli-app\gulpfile.js
[11:14:58] Starting 'publish'...
[11:14:58] Packed 'foo.0.0.0.2.tar.gz' with 10 files
C:\Source\blank-angular-cli-app\node_modules\@octopusdeploy\octopackjs\lib\pack.js:26
throw err;
^
Error: ENOENT: no such file or directory, stat 'C:\Source\blank-angular-cli-app\assets'
at Error (native)
它显然对包含子文件夹的 /dist 文件夹不满意(如果我在构建后将文件夹添加到 dist 中,我会得到同样的错误)。但我不确定为什么,以及如何处理。
发生了什么事?如何修复此部署?
Github 上的一个最小示例是我使用 ng init (angular-cli) 创建的空白应用程序,然后添加了 gulp 和 octopus。
【问题讨论】:
-
解决了这个问题,很快就会回答。我认为 gulp-octo 中的错误。
标签: angular angular-cli octopus-deploy octopack