Skip to content

eriksoderblom/gitlab-php-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

gitlab-php-hook

PHP Hook for pulling new git commits from server

You need to update the configuration variables in githook.php to fit your system.
Your key is set in githook.php
Usage: http://example.com/githook.php?key={your_key}

If you want to do a hard reset before pulling, you should append &ignore=1 to the hook url.
For example: http://example.com/githook.php?key={your_key}&ignore=1

You need to have an SSH key for the user apache runs on, which in my case is www-data. I used this method to make it work: Create ssh folder (www-data has /var/www as home directory) sudo -u www-data mkdir -p /var/www/.ssh/ Create SSH key sudo -u www-data ssh-keygen -t rsa

Then you need to add the public key generated by that command (/var/www/.ssh/id_rsa.pub) to either your account on the gitlab server or to the deploy keys for your projects

I made the first pull of the project to my server using sudo -u www-data git clone git@github.com:exampleuser/example.git This prompted me to add that host to known_hosts.

After these steps everything should work.

About

PHP Hook for pulling new commits from server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages