Question:
No matter what I put inside the stop_server
file the CodeDeploy ends up with the error as above.
I even commented out all the lines to simplify debugging, so now it looks inside like this
1 2 3 |
#!/bin/bash # pkill -f node |
My appspec.yml
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
version: 0.0 os: linux files: - source: /app.js destination: /home/ec2-user/node-website - source: /package.json destination: /home/ec2-user/node-website - source: /public/ destination: /home/ec2-user/node-website/public - source: /node_modules destination: /home/ec2-user/node-website/node_modules permissions: - object: / pattern: "**" owner: ec2-user group: ec2-user hooks: AfterInstall: - location: scripts/install_dependencies timeout: 300 runas: ec2-user #- location: scripts/codestar_remote_access # timeout: 300 # runas: ec2-user - location: scripts/start_server timeout: 300 runas: ec2-user ApplicationStop: - location: scripts/stop_server timeout: 300 runas: ec2-user |
Any sugestions highly appreciated!
Answer:
When you do a deployment, it will actually use the ApplicationStop from your last successful deployment, not your current deployment. I resolved the problem by deleting the application that I have problem with and creating a new one.