2 Answers
- Newest
- Most votes
- Most comments
0
- Correct the clean.sh file path in appspec.yml and ensure it's relative to the root of your repo.
- Fix the script command: Change sudo rm -rf cd /var/www/html/myapi to sudo rm -rf /var/www/html/myapi.
Make scripts executable:
bash
chmod +x scripts/*.sh
- Check logs at /var/log/aws/codedeploy-agent/codedeploy-agent.log for more insights.
Related Document links:
0
Does Codedeploy agent have rights to enter and operate the folder where the files are ?
Yes pipeline role have all the roles necessary for s3,ec2 code deploy..etc
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 3 years ago

Thanks for the reply.
Not working
ensure correct file path in appspec.yml: yaml files:
BeforeInstall:
sudo service codedeploy-agent restart Log script execution by adding: bash echo "Started..." >> /tmp/deploy.log
The script exits in the below folder
/opt/codedeploy-agent/deployment-root/1d92a9f8-4e3b-a736-0794b8261319/d-X2H97/deployment-archive/scripts/