notification of repo remote cloning complete via db message
[gwvp-mini.git] / bin / gwvpminicmdtool.php
index e4f6fe1..3f59778 100644 (file)
@@ -74,6 +74,27 @@ function gwvpcmdtool_Usage()
 function gwvpcmdtool_BackGroundClone()
 {
        // here we parse arguments and have stuff with things and its 6am why am i doing this right now?
+       global $data_directory, $argv;
+       
+       $repo_base = gwvpmini_getConfigVal("repodir");
+       
+       sleep(60);
+       
+       $from = $argv[1];
+       $to = $argv[2];
+       echo "Would actually clone $from to $to in $data_directory\n";
+       //sleep(20);
+       
+       $cmd = "git clone --bare $from $repo_base/$to.git";
+       exec($cmd);
+       $rn = gwvpmini_getRepo(null, $to, null);
+       $rid = $rn["id"];
+       $uid = $rn["ownerid"];
+       gwvpmini_EnableRepo($rid);
+       
+       //gwvpmini_SendMessageByDb($type, $data, $forid)
+       gwvpmini_SendMessageByDb("info", "Repo $to has finished cloning and now ready", $uid);
+       echo "update $to ($rid) and enabled it\n";
 }
 
 // update will log things like branch and tag creations