I'm trying to deploy my code to ec2 instance using aws codedeploy and github, but the logs on my ec2 instance at:
/var/log/aws/codedeploy-agent/codedeploy-agent.log
says :
The CodeDeploy agent did not find an AppSpec file within the unpacked revision directory at revision-relative path "appspec.yml". The revision was unpacked to directory "/opt/codedeploy-agent/deployment-root/a018a999-b075-4d7a-a010-d08bd93ecbfb/d-3B1NFWVEL/deployment-archive", and the AppSpec file was expected but not found at path "/opt/codedeploy-agent/deployment-root/a018a999-b075-4d7a-a010-d08bd93ecbfb/d-3B1NFWVEL/deployment-archive/appspec.yml
My flow goes like this:-
code on local machine -> push to github -> aws codedeploy -> aws ec2 instance
Here's my appspec.yml file code:-
version: 0.0
os: linux
files:
- source: "**/*"
destination: /var/www/html/office_new
hooks:
ApplicationStop:
- location: scripts/stop_server.sh
timeout: 300
runas: ubuntu
ApplicationStart:
- location: scripts/start_server.sh
timeout: 300
runas: ubuntu
Here's my folder structure:-
<my-root-folder>/
├── folder_1/
│ ├── file_1
│ ├── file_2
│ └── file_3
├── folder_2/
│ ├── file_1
│ ├── file_2
│ └── file_3
├── appspec.yml
└── otherfiles
Any help will be greatly appreciated thanks.