I have the following definition in the appspec file -
hooks: AfterInstall: - location: afterInstall.sh
The following is the contents of afterInstall.sh (I'm trying to call a php file from a sh file) -
php afterInstall.php
Both afterInstall.sh and afterInstall.php files are on the same level (the most external level) in the zip archive, which I upload to S3 -
appspec.yml afterInstall.sh afterInstall.php
I get the following error:
Error Code ScriptFailed Script Name afterInstall.sh Message Script at specified location: afterInstall.sh failed with exit code 1 Log Tail LifecycleEvent - AfterInstall Script - afterInstall.sh [stderr]Could not open input file: afterInstall.php
I also tried adding the following to the permissions section of the apppec file -
permissions: - object: . pattern: "**" owner: sandeepan group: sandeepan mode: 777 type: - file
Note. I have login credentials for deployment instances using the sandeepan user.
I'm a little confused about what the permissions section does. From http://docs.aws.amazon.com/codedeploy/latest/userguide/app-spec-ref-permissions.html ,
The Permissions section indicates how special permissions, if any, should be applied to files and directories / folders in files after copying to an instance.
I also tried to specify the owner / group as root / root and runas: root against hook after installation, but still get the same error.
Update
I also tried to specify the afterInstall.php file in the file section and make sure that its permissions and rights are correct -
- source: afterInstall.php destination: /var/cake_1.2.0.6311-beta
In / var / cake_1.2.0.6311-beta -
-rwxrwxr-x 1 sandeepan sandeepan 26 Aug 1 08:55 afterInstall.php
I have no other idea what else needs to be done to fix this.
Note. I can successfully deploy if I do not call the php file from the afterInstall.sh file