1 | <?php namespace Magestead\Service; |
||
6 | class VersionControl |
||
7 | { |
||
8 | protected $_output; |
||
9 | protected $_repoUrl; |
||
10 | protected $_projectPath; |
||
11 | |||
12 | /** |
||
13 | * VersionControl constructor. |
||
14 | * @param $repoUrl |
||
15 | * @param $projectPath |
||
16 | * @param OutputInterface $output |
||
17 | */ |
||
18 | public function __construct($repoUrl, $projectPath, OutputInterface $output) |
||
19 | { |
||
20 | $this->_output = $output; |
||
21 | $this->_repoUrl = $repoUrl; |
||
22 | $this->_projectPath = $projectPath; |
||
23 | |||
24 | $this->execute($output); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param OutputInterface $output |
||
29 | */ |
||
30 | protected function execute(OutputInterface $output) |
||
41 | |||
42 | /** |
||
43 | * Initialise the GIT repo |
||
44 | * |
||
45 | * @return $this |
||
46 | */ |
||
47 | public function init() |
||
54 | |||
55 | /** |
||
56 | * Add all file to the GIT index |
||
57 | * |
||
58 | * @return $this |
||
59 | */ |
||
60 | public function addFiles() |
||
67 | |||
68 | /** |
||
69 | * Commit the files to the repo |
||
70 | * |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function commitFiles() |
||
80 | |||
81 | /** |
||
82 | * Push all the files to remote repo |
||
83 | * |
||
84 | * @return $this |
||
85 | */ |
||
86 | public function pushFiles() |
||
93 | } |
||
94 |