Created
August 12, 2015 17:28
-
-
Save xtarx/375d20de5994491b2472 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make sure to create the SSH using the “apache” user. | |
# Added this to fix apache git pull | |
apache ALL = NOPASSWD: /usr/bin/git | |
sudo su apache | |
sudo su ec2-user | |
sudo rm -rf /var/www/html/echogit/ | |
#list file permissions | |
namei -m | |
sudo chown -R apache:apache /var/www/.ssh | |
#add rep to config file in ssh folder | |
Host echohr | |
HostName bitbucket.org | |
IdentityFile /var/www/.ssh/echohr | |
#creat ssh keys | |
sudo -Hu apache ssh-keygen -t rsa -f /var/www/.ssh/echohr | |
sudo cat /var/www/.ssh/echohr.pub | |
#set permission | |
sudo chown -R apache:apache /var/www/html/echoHRV1.0 | |
#clone git | |
sudo -Hu apache git clone git@echohr:ngageu/ecohr.git /var/www/html/echoHRV1.0 | |
#move to upper dir | |
sudo mv * .[^.]* .. | |
#get current git version revision | |
git rev-parse HEAD | |
sudo -Hu apache git rev-parse HEAD | |
Refrences | |
https://github.com/lkwdwrd/git-deploy | |
https://gist.github.com/oodavid/1809044 | |
permissions and groups gitwriters | |
http://stackoverflow.com/questions/5144039/shell-exec-and-git-pull |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment