1 Resposta
- Mais recentes
- Mais votos
- Mais comentários
0
To rollback the deployment if the E2E tests fail, you can add a rollback step after the E2ETests step in your pipeline stage.
The rollback step would use the AWS CLI cloudformation rollback command to roll back the CloudFormation stack deployed by the RestSvc.Deploy action.
For example:
Add a new CodeBuild step after E2ETests:
betaStage.addPost(new pipelines.CodeBuildStep(E2ETests, {
//...
}))
betaStage.addPost(new pipelines.CodeBuildStep(Rollback, {
commands: [
'aws cloudformation rollback --stack-name RestSvcStack'
]
}))
This will roll back the RestSvcStack if E2ETests fails. The pipeline will then continue to the next stage with the previous version deployed.
You may also want to add error handling or conditions to only execute the rollback step if E2ETests fails/errors out.
Conteúdo relevante
- AWS OFICIALAtualizada há 3 anos
- AWS OFICIALAtualizada há 2 meses
- AWS OFICIALAtualizada há 2 anos
How do you rollback only if
E2ETests
failed? It looks like the second step would roll back unconditionally. My current attempt is to update thecommand
property of theE2ETests
approval action:Unfortunately, this fails with an error:
An error occurred (AccessDenied) when calling the RollbackStack operation: Cross-account pass role is not allowed.