The deployment specifies that the revision is a null file, but the revision provided is a zip file

不想你离开。 提交于 2020-01-13 05:08:29

问题


I am using CodeDeploy integrated into CodePipeline. I am trying to deploy an image from ecr to ecs.

The whole infrastructure is built with CloudFormation.

The template for the Pipeline deployment group:

ApplicationName=cls.application.ApplicationName,
DeploymentGroupName='DeploymentGroup',
DeploymentConfigName='CodeDeployDefault.ECSAllAtOnce',
ServiceRoleArn=GetAtt(cls.role, 'Arn'),
AutoRollbackConfiguration={
    'enabled': True,
    'events': ['DEPLOYMENT_FAILURE', 'DEPLOYMENT_STOP_ON_ALARM', 'DEPLOYMENT_STOP_ON_REQUEST']
},
DeploymentStyle={
    'deploymentType': 'BLUE_GREEN',
    'deploymentOption': 'WITH_TRAFFIC_CONTROL'
},
BlueGreenDeploymentConfiguration={
    'terminateBlueInstancesOnDeploymentSuccess': {
        'action': 'TERMINATE',
        'terminationWaitTimeInMinutes': 5
    },
    'deploymentReadyOption': {
        'actionOnTimeout': 'CONTINUE_DEPLOYMENT',
    },
},
LoadBalancerInfo= <Some irrelevant config>
EcsServices=[
    {
        'serviceName': 'WordpressService',
        'clusterName': 'WordpressCluster'
    },
]

So far - the configuration seems pretty straight-forward. The configuration for the pipeline itself contains 2 stages:

ArtifactStore=ArtifactStore(
    Location='SomeS3Location',
    Type='S3'
),
Name='WordpressPipeline',
RoleArn=GetAtt(cls.role, 'Arn'),
Stages=[
    Stages(
        Name='SourceStage',
        Actions=[
            Actions(
                Name='SourceAction',
                ActionTypeId=ActionTypeId(
                    Category='Source',
                    Owner='AWS',
                    Version='1',
                    Provider='ECR'
                ),
                OutputArtifacts=[
                    OutputArtifacts(
                        Name='SourceOutput'
                    )
                ],
                Configuration={
                    'RepositoryName':'SomeECR'
                },
                RunOrder='1'
            )
        ]
    ),
    Stages(
        Name='DeployStage',
        Actions=[
            Actions(
                Name='DeployAction',
                ActionTypeId=ActionTypeId(
                    Category='Deploy',
                    Owner='AWS',
                    Version='1',
                    Provider='CodeDeploy'
                ),
                InputArtifacts=[
                    InputArtifacts(
                        Name='SourceOutput'
                    )
                ],
                Configuration={
                    'ApplicationName': 'MyApp',
                    'DeploymentGroupName': 'MyGroup'
                },
                RunOrder='1'
            )
        ]
    )
]

P.S. dont mind the syntax. I am using Troposphere to create CloudFormation templates.

Firstly, the CloudFormation template ran successfully.

Secondly, Sourcing from ECR succeed.

Thirdly, deployment fails with message:

The deployment specifies that the revision is a null file, but the revision provided is a zip file.

Do you have any idea where might be the problem?

Thank you in advance.


回答1:


Found out where the issue was. The deploy provider was CodeDeploy which is not valid for my blue/green deployments. I hade to specify CodeDeployToECS instead. Also, I had to change required environment parameters. Here is a nice tutorial by AWS: https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-ecs-ecr-codedeploy.html#tutorials-ecs-ecr-codedeploy-pipeline



来源:https://stackoverflow.com/questions/57837028/the-deployment-specifies-that-the-revision-is-a-null-file-but-the-revision-prov

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!