Duong Tuan Nhat
Duong Tuan Nhat

Reputation: 39

How to automatically deploy when push code like Heroku on my server

Like Heroku, I want my code be compiled and deployed when I push it to repo by git, and compile messages be showed on console. Not like CI tool that push code normally and show error later over email or on a dashboard. Sorry for my English.

Upvotes: 0

Views: 51

Answers (1)

ceejayoz
ceejayoz

Reputation: 180024

You'd do this via a Git hook, specifically the post-receive one.

This hook is invoked by git-receive-pack[1] when it reacts to git push and updates reference(s) in its repository. It executes on the remote repository once after all the refs have been updated.

Both standard output and standard error output are forwarded to git send-pack on the other end, so you can simply echo messages for the user.

Upvotes: 1

Related Questions