S
S
Stanislav Pochepko2016-02-24 13:03:30
PHP
Stanislav Pochepko, 2016-02-24 13:03:30

Script for auto-deploy to the server?

Good afternoon. I am studying automatic application deployment by push to a remote repository on github. And put some information, but not all. As I understand it, how to go through the process:
During the push to the repository on github, a hook with the specified Payload URL of my script on the server ( myserver.net/auto_script.php) should work.
GitHub sends information about the event that happened there. In the example on GitHub, they provide a hook for an open issue

POST /payload HTTP/1.1

Host: localhost:4567
X-Github-Delivery: 72d3162e-cc78-11e3-81ab-4c9367dc0958
User-Agent: GitHub-Hookshot/044aadd
Content-Type: application/json
Content-Length: 6615
X-Github-Event: issues

{
  "action": "opened",
  "issue": {
    "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
    "number": 1347,
    ...
  },
  "repository" : {
    "id": 1296269,
    "full_name": "octocat/Hello-World",
    "owner": {
      "login": "octocat",
      "id": 1,
      ...
    },
    ...
  },
  "sender": {
    "login": "octocat",
    "id": 1,
    ...
  }
}

exec(...)As I understand it, I need to write a git pull owner/repository command in a php script ? Where can I find a ready-made script or example. And then I write bydlokoda and bicycles. Yes and B - security.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Krasavin, 2016-02-24
@DJZT

https://github.com/capistrano/capistrano
or the first link in google 'php deploy auto':
https://github.com/markomarkovic/simple-php-git-deploy

T
TyzhSysAdmin, 2016-02-24
@POS_troi

I will add Oleg Krasavin
Anton Suprun rolled out such a thing the same popel-studio.com/blog/article/avtomaticheskoe-razv...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question