我正在尝试使用CodeDeploy插件从Jenkins部署代码到AWS EC2。构建和上传到S3工作正常。应该部署到EC2时会出现问题。该插件抱怨没有配置。我的第一个猜测是它指的是解决方案根目录中的appspec.yml,但我开始认为这是我在路上错过的其他一些配置。你觉得怎么样?
C:\Program Files (x86)\Jenkins\workspace\FILVAL-Dev>exit 0
Zipping files into C:\Windows\TEMP\#38-7546986511493287644.zip
Uploading zip to s3://filval/#38-7546986511493287644.zip
Registering revision for application 'ValidationService'
Creating deployment with revision at {RevisionType: S3,S3Location: {Bucket: filval,Key: #38-7546986511493287644.zip,BundleType: zip,ETag: 7d140edf523ea132fe10421b0fa5db1e},}
Failed CodeDeploy post-build step; exception follows.
No deployment configuration found for name: CodeDeploymentDefault.OneAtATime (Service: AmazonCodeDeploy; Status Code: 400; Error Code: DeploymentConfigDoesNotExistException; Request ID: 2acde7f6-04bc-11e8-b3aa-87f32971b619)
com.amazonaws.services.codedeploy.model.DeploymentConfigDoesNotExistException: No deployment configuration found for name: CodeDeploymentDefault.OneAtATime (Service: AmazonCodeDeploy; Status Code: 400; Error Code: DeploymentConfigDoesNotExistException; Request ID: 2acde7f6-04bc-11e8-b3aa-87f32971b619)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1639)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1304)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1056)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667)
at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513)
at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.doInvoke(AmazonCodeDeployClient.java:3358)
at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.invoke(AmazonCodeDeployClient.java:3334)
at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.executeCreateDeployment(AmazonCodeDeployClient.java:1300)
at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.createDeployment(AmazonCodeDeployClient.java:1276)
at com.amazonaws.codedeploy.AWSCodeDeployPublisher.createDeployment(AWSCodeDeployPublisher.java:415)
at com.amazonaws.codedeploy.AWSCodeDeployPublisher.perform(AWSCodeDeployPublisher.java:237)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1749)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
ERROR: Step ‘Deploy an application to AWS CodeDeploy’ failed: null
Finished: FAILURE
答案 0 :(得分:2)
错误表明您使用了错误的部署配置。这些是default configurations:
请注意,您拥有 CodeDeploy 精神 Default.OneAtATime ,它应该是 CodeDeployDefault.OneAtATime 。
在Jenkins上,您可以在此处进行更改:
的图片