Files
boost-tasks/upload-this-to-server
2015-10-10 12:31:53 +01:00

36 lines
846 B
PHP
Executable File

#!/usr/bin/php
<?php
/*
* Copyright 2013 Daniel James <daniel@calamity.org.uk>.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
require_once(__DIR__.'/vendor/autoload.php');
try {
$dst = EvilGlobals::$data_root.'/upload';
if (is_dir($dst)) {
Process::run("rm -r {$dst}");
}
mkdir($dst);
Process::run("git archive master | tar -x -C {$dst}", __DIR__);
Process::run("rm -r {$dst}/nbproject");
Process::run("rsync -az {$dst}/ dnljms@boost.org:boost-tasks/");
echo "rsync -az {$dst}/ dnljms@boost.org:boost-tasks/";
}
catch (\RuntimeException $e) {
Log::error("Runtime exception: {$e}");
exit(1);
}
// Return an error code if an error was logged.
if (Log::$error) {
exit(1);
}