I am currently using CodeDeploy for a NodeJS application of mine and I just have 1 burning question, is there a way to instruct say, my BeforeInstall script to run on the revision root instead of the root directory of my Linux OS?
For instance, the BeforeInstall hook script of mine may looks like this:
#!/bin/bash
echo "Current directory: "
echo $PWD
echo `ls`
# Do actual stuff here
By looking at the log it seemed to me that the script is ran on / (OS root), how do I instruct it to run on the revision root? I know I can CD into /opt/codedeploy-agent/deployment-root/app-id/deployment-id
but it just seemed like a hassle to me to retrieve the app id and deployment id every time.