Reputation:
appspe.yml script:
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/
permissions:
- object: /home/ubuntu/
owner: root
group: root
mode: 777
hooks:
BeforeInstall:
- location: scripts/install_dependencies.sh
timeout: 300
runas: root
- location: scripts/start_server.sh
timeout: 300
runas: root
ApplicationStop:
- location: scripts/stop_server.sh
timeout: 300
runas: root
Unfortunately, it didn't copy the files to /home/ubuntu/
directory. With this, I am getting the following error while deploying through codedeploy
LifecycleEvent - BeforeInstall Script - scripts/install_dependencies.sh Script - scripts/start_server.sh [stderr]cp: cannot stat 'scripts/gunicorn.service': No such file or directory [stderr]Failed to start gunicorn.service: Unit gunicorn.service not found. [stderr]Failed to execute operation: No such file or directory [stderr]Failed to restart gunicorn.service: Unit gunicorn.service not found. [stderr]cp: cannot stat 'scripts/LIMA': No such file or directory [stderr]ln: failed to create symbolic link '/etc/nginx/sites-enabled/LIMA': File exists [stderr]ERROR: Bad port
What went wrong here?
Upvotes: 0
Views: 4679
Reputation: 1695
I faced the same issue.
When I moved the commands in the "BeforeInstall" hook to the "AfterInstall" hook it worked for me.
Upvotes: 3
Reputation: 77
Your errors seem to be of the following categories:
Missing files. ([stderr]cp: cannot stat 'scripts/gunicorn.service': No such file or directory). Debug: Check if the file actually exists in your deployment bundle. Check the bundle itself and the logs here: less /opt/codedeploy-agent/deployment-root/deployment-group-ID/deployment-ID/. See here
Failure to create symlink because it already exists. ([stderr]ln: failed to create symbolic link '/etc/nginx/sites-enabled/LIMA': File exists). This is not related to file overwrite. Probably there is a 'ln' command somewhere in your script to create the symlink. Debug: Modify the script to test the symlink for existence and then create it.
I hope this helps.
Upvotes: 1