Reputation: 1373
Hope someone can help me with this.
I have set up an EC2 with EFS mounted to it.
The EFS basically contains the WordPress source code.
What is the best way to set up an automated process to update the source code inside the EFS from a bitbucket repository.
I'm able to ssh to the server and run git pull (a bit slow), but I want to set up an auto-scaler later, and I want a way to deploy the code changes directly into the EFS without doing the SSh on the ec2 instance.
Thanks
Upvotes: 0
Views: 1154
Reputation: 1527
Easiest way, have a cron job that runs git pull
every day, or whatever frequency you want.
If you want to be fancier, then have it run git fetch
and then depending on the changes, run a pull.
If you want to be secure, create a read-only bitbucket account so if someone infiltrates your EC2 host they cant mess up your repo.
If you want to be able to monitor it, you can make the script ping AWS CloudWatch and add alarms so if your cron fails, you can set it back up.
Upvotes: 1