Please make sure that your are using the correct relative path.
In AppSpec.yaml, I noticed that
server_clear.sh path is prefixed with
script/ which is not the case of the remaining scripts. The location of scripts you specify in the hooks section is relative to the root of the application revision bundle.
Please check the references below:
CodeDeploy old versions on EC2 instancesasked a month ago
Is it possible to use artifacts in an S3 Bucket From a Different Region To CodeDeploy Application
CodeDeploy Environment Variables On Windowsasked 5 months ago
Ruby version mismatch while deploying Rails App with CodeDeploy and CodePipeline Scripts on Ubuntu 20.0 EC2asked a month ago
CodeDeploy - BeforeInstall ScriptMissingasked 6 days ago
CodeDeploy Pipeline Failures from appspec Missing Filesasked 6 months ago
Is It Possible to CodeDeploy to an EC2 Instance In A Different Region
CodeDeploy configuration specifies HalfAtATime, but deployment history shows AllAtOnceasked 3 months ago
CodeDeploy, deployment failed after EC2 changed instance typeasked 3 years ago
Unable to access Spring Boot application deployed on AWS EC2 instance (Windows Server 2022)asked 2 months ago