1 | <?php namespace Magestead\Service; |
||
6 | class VersionControl |
||
7 | { |
||
8 | protected $_repoUrl; |
||
9 | protected $_projectPath; |
||
10 | protected $_output; |
||
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->_repoUrl = $repoUrl; |
||
21 | $this->_projectPath = $projectPath; |
||
22 | $this->_output = $output; |
||
23 | |||
24 | $this->execute($output); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param OutputInterface $output |
||
29 | */ |
||
30 | protected function execute(OutputInterface $output) |
||
44 | |||
45 | /** |
||
46 | * Initialise the GIT repo |
||
47 | * |
||
48 | * @return $this |
||
49 | */ |
||
50 | public function init() |
||
57 | |||
58 | /** |
||
59 | * Add all file to the GIT index |
||
60 | * |
||
61 | * @return $this |
||
62 | */ |
||
63 | public function addFiles() |
||
70 | |||
71 | /** |
||
72 | * Commit the files to the repo |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function commitFiles() |
||
83 | |||
84 | /** |
||
85 | * Push all the files to remote repo |
||
86 | * |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function pushFiles() |
||
96 | } |
||
97 |