CodeDeploy DownloadBundle:未找到中央目录签名的 Zip 结尾

CodeDeploy DownloadBundle : Zip end of central directory signature not found

我正在使用 Jenkins 开始部署过程。

"C:\Program Files\Amazon\AWSCLI\bin\aws.exe" deploy create-deployment --application-name App.Web --deployment-config-name CodeDeployDefault.OneAtATime --deployment-group-name Development --region us-west-2 --description "App.Web" --s3-location bucket=app-artifacts,bundleType=zip,key=development/Web.zip

我的工件确实存在于 S3 上并且是使用 7zip 与 Jenkins 构建的

"C:\Program Files-Zipz.exe" a Web.zip "%WORKSPACE%\App.Web\bin\Release\Publish\*"

并这样发布:

我收到这个错误: DownloadBundle:未找到中央目录签名的 Zip 结尾

目前我们正在使用 Jenkins codedeploy 插件来完成这项工作。 Jenkins Code deploy 尽管存在文件存在行为问题。因此我们有 fixed and given pullrequest . If you want Added fileExistsBehavior --file-exists-behavior support then build the plugin

流水线通常如下所示

step([$class: 'AWSCodeDeployPublisher', applicationName: 'App.Web', awsAccessKey: 'ERAKIAI-aws-access-key', awsSecretKey: '73I28EY7vFx-aws-secret-key', credentials: 'awsAccessKey', deploymentConfig: 'CodeDeployDefault.OneAtATime', deploymentGroupAppspec: false, deploymentGroupName: 'Development', excludes: '',fileExistsBehavior: 'OVERWRITE', iamRoleArn: 'arn:aws:iam::724978192355:role/codedeploy-jenkins', includes: '**', proxyHost: '', proxyPort: 0, region: 'us-west-2', s3bucket: 'app-artifacts', s3prefix: 'app-artifacts-codedeploy', subdirectory: 'scripts/in-appspec', versionFileName: '', waitForCompletion: true])

在上面的管道脚本中 subdirectory: 'scripts/in-appspec' 是 codedeploy 工作区。您将在其中放置所有 appspec.ymlshell scripts

例如 。 jenkins codedeploy 自动zip 上传到s3 然后触发codedeploy。

如果您想将 codedeploy 添加到 jenkins freestyle 作业中,请添加 Post-build Actions Deploy an application to AWS CodeDeploy