I am working on simple website hosted on AWS EC2 instance. When I change the code then I push it on GitHub and manually access the EC2 instance using putty then take pull of new changes from GitHub.
I want to do this work programmatically in node, in which I write commands and these commands should run on my EC2 instance.
I read
aws-sdk documentation and it works fine, but these command are for specific purpose like Run, Reboot, Restart, Describe the instance. But I want to run any Linux(ubuntu) command on my EC2 instance, for example:
sudo mkdir /var/www/frontend/directoryName;
...........
...........
#whatever commands I want to run like git pull...blah blah blah
What I have tried:
I spend much time to find such type documentation using node but couldn't find. In my company, my collogue wrote a script in python for same purpose and it is working fine. but I want to write such type of script in node.
Please someone help me, who have any idea about this. Thank you!