-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathRoboFile.php
26 lines (25 loc) · 930 Bytes
/
RoboFile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
// define public methods as commands
public function up( $note = 'update' )
{
$repo = "https://gitlab.com/easychen/memberprism2.git";
$this->_exec("git add . && git commit -m '$note' && git push");
$tmp_dir = '/tmp/MPT'.md5($repo);
if( file_exists( $tmp_dir ) )
{
$this->_exec("cd $tmp_dir && git pull");
}
else
{
$this->_exec("git clone $repo $tmp_dir");
}
$this->_exec("cd $tmp_dir && cp -rf ./* /Users/Easy/Code/gitcode/MemberPrism2/ && cp -rf ./.vscode /Users/Easy/Code/gitcode/MemberPrism2/ && cp -rf ./.vscode /Users/Easy/Code/gitcode/MemberPrism2/ && cd /Users/Easy/Code/gitcode/MemberPrism2/ && git add . && git commit -m '$note' && git push");
}
}