我正在设置一个 AutoCI -> Jenkins -> Octopus 自动构建过程。我使用一个名为 octopackjs & gulp-octo 的包将我的 node.js 项目打包成一个 .tar 文件,如下所示:
return gulp.src(['**/*', '!gulpfile.js'])
.pipe(octo.pack("tar.gz"))
.pipe(octo.push({apiKey: 'API-SUPERCOOLKEY', host: 'https://octopus.supercooldomain.net', replace: true}));
我可以打包它,它被推送到八达通服务器的正确位置。但是,当我检查该 .tar 文件的内容时,它被数百个名为“PaxHeader”的文件所污染。环顾四周,该文件旨在包含 .tar 包的元数据。当 Octopus 尝试将该文件提取到我的目标环境时,它会抛出以下错误跟踪:
System.IO.IOException: Cannot create /home/opsteam/.octopus/Applications/OctopusServer/Dev.Corporate/webapp/2.0.10/PaxHeader because a file with the same name already exists.
09:46:34Error
at System.IO.Directory.CreateDirectory (System.String path) <0x7fdc9e79db50 + 0x00167> in <filename unknown>:0
09:46:34Error
at SharpCompress.Reader.IReaderExtensions.WriteEntryToDirectory (IReader reader, System.String destinationDirectory, ExtractOptions options) <0x4033e800 + 0x00260> in <filename unknown>:0
09:46:34Error
at Calamari.Integration.Packages.TarPackageExtractor.Extract (System.String packageFile, System.String directory, Boolean suppressNestedScriptWarning) <0x4033b4f0 + 0x000f3> in <filename unknown>:0
09:46:34Error
at Calamari.Integration.Packages.GenericPackageExtractor.Extract (System.String packageFile, System.String directory, Boolean suppressNestedScriptWarning) <0x4033b4a0 + 0x0003b> in <filename unknown>:0
09:46:34Error
at Calamari.Deployment.Conventions.ExtractPackageConvention.Install (Calamari.Deployment.RunningDeployment deployment) <0x40335ac0 + 0x000bb> in <filename unknown>:0
09:46:34Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions () <0x4030aaa0 + 0x00065> in <filename unknown>:0
09:46:34Error
at Calamari.Deployment.ConventionProcessor.RunConventions () <0x4030a940 + 0x0001f> in <filename unknown>:0
到底是怎么回事?为什么我的 .tar 文件有这些工件?
编辑:这些 PaxHeader 文件的内容,当以文本形式打开时,范围从项目中模块的 package.json 内容到随机许可信息,再到目录、字符串列表等……