|
|
@ -12,7 +12,6 @@ define("ENV_HTTPS_APP_VALUE", "HTTPS_APP_VALUE"); |
|
|
|
define("ENV_HTTPS_TOKEN_VALUE", "HTTPS_TOKEN_VALUE"); |
|
|
|
define("ENV_HTTPS_TOKEN_VALUE", "HTTPS_TOKEN_VALUE"); |
|
|
|
|
|
|
|
|
|
|
|
define("PRIMARY_TOKEN_FILE", '/home/krad/.sandcastle'); |
|
|
|
define("PRIMARY_TOKEN_FILE", '/home/krad/.sandcastle'); |
|
|
|
define("SECONDARY_TOKEN_FILE", '$HOME/.sandcastle'); |
|
|
|
|
|
|
|
define("CONT_RUN_ALIAS", "leveldb"); |
|
|
|
define("CONT_RUN_ALIAS", "leveldb"); |
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////// |
|
|
|
////////////////////////////////////////////////////////////////////// |
|
|
@ -25,9 +24,7 @@ function postURL($diffID, $url) { |
|
|
|
$cmd = 'echo \'{"diff_id": "' . $diffID . '", ' |
|
|
|
$cmd = 'echo \'{"diff_id": "' . $diffID . '", ' |
|
|
|
. '"name":"click here for sandcastle tests for D' . $diffID . '", ' |
|
|
|
. '"name":"click here for sandcastle tests for D' . $diffID . '", ' |
|
|
|
. '"link":"' . $url . '"}\' | ' |
|
|
|
. '"link":"' . $url . '"}\' | ' |
|
|
|
. 'no_proxy=facebook.com,tfbnw.net,fb.com ' |
|
|
|
. 'arc call-conduit ' |
|
|
|
. 'http_proxy=fwdproxy.any.facebook.com:8080 ' |
|
|
|
|
|
|
|
. 'https_proxy=fwdproxy.any.facebook.com:8080 arc call-conduit ' |
|
|
|
|
|
|
|
. 'differential.updateunitresults'; |
|
|
|
. 'differential.updateunitresults'; |
|
|
|
shell_exec($cmd); |
|
|
|
shell_exec($cmd); |
|
|
|
} |
|
|
|
} |
|
|
@ -41,9 +38,7 @@ function buildUpdateTestStatusCmd($diffID, $test, $status) { |
|
|
|
$cmd = 'echo \'{"diff_id": "' . $diffID . '", ' |
|
|
|
$cmd = 'echo \'{"diff_id": "' . $diffID . '", ' |
|
|
|
. '"name":"' . $test . '", ' |
|
|
|
. '"name":"' . $test . '", ' |
|
|
|
. '"result":"' . $status . '"}\' | ' |
|
|
|
. '"result":"' . $status . '"}\' | ' |
|
|
|
. 'no_proxy=facebook.com,tfbnw.net,fb.com ' |
|
|
|
. 'arc call-conduit ' |
|
|
|
. 'http_proxy=fwdproxy.any.facebook.com:8080 ' |
|
|
|
|
|
|
|
. 'https_proxy=fwdproxy.any.facebook.com:8080 arc call-conduit ' |
|
|
|
|
|
|
|
. 'differential.updateunitresults'; |
|
|
|
. 'differential.updateunitresults'; |
|
|
|
return $cmd; |
|
|
|
return $cmd; |
|
|
|
} |
|
|
|
} |
|
|
@ -108,8 +103,7 @@ function getSteps($applyDiff, $diffID, $username, $test) { |
|
|
|
// Patch the code (keep your fingures crossed). |
|
|
|
// Patch the code (keep your fingures crossed). |
|
|
|
$patch = array( |
|
|
|
$patch = array( |
|
|
|
"name" => "Patch " . $diffID, |
|
|
|
"name" => "Patch " . $diffID, |
|
|
|
"shell" => "no_proxy=facebook.com,tfbnw.net,fb.com " |
|
|
|
"shell" => "arc --arcrc-file ~/.arcrc " |
|
|
|
."HTTPS_PROXY=fwdproxy:8080 arc --arcrc-file ~/.arcrc " |
|
|
|
|
|
|
|
. "patch --nocommit --diff " . $diffID, |
|
|
|
. "patch --nocommit --diff " . $diffID, |
|
|
|
"user" => "root" |
|
|
|
"user" => "root" |
|
|
|
); |
|
|
|
); |
|
|
@ -178,6 +172,8 @@ function getSteps($applyDiff, $diffID, $username, $test) { |
|
|
|
function getSandcastleConfig() { |
|
|
|
function getSandcastleConfig() { |
|
|
|
$sandcastle_config = array(); |
|
|
|
$sandcastle_config = array(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$cwd = getcwd(); |
|
|
|
|
|
|
|
$cwd_token_file = "{$cwd}/.sandcastle"; |
|
|
|
// This is a case when we're executed from a continuous run. Fetch the values |
|
|
|
// This is a case when we're executed from a continuous run. Fetch the values |
|
|
|
// from the environment. |
|
|
|
// from the environment. |
|
|
|
if (getenv(ENV_POST_RECEIVE_HOOK)) { |
|
|
|
if (getenv(ENV_POST_RECEIVE_HOOK)) { |
|
|
@ -188,20 +184,20 @@ function getSandcastleConfig() { |
|
|
|
// configuration files. |
|
|
|
// configuration files. |
|
|
|
for ($i = 0; $i < 50; $i++) { |
|
|
|
for ($i = 0; $i < 50; $i++) { |
|
|
|
if (file_exists(PRIMARY_TOKEN_FILE) || |
|
|
|
if (file_exists(PRIMARY_TOKEN_FILE) || |
|
|
|
file_exists(SECONDARY_TOKEN_FILE)) { |
|
|
|
file_exists($cwd_token_file)) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
// If we failed to fetch the tokens, sleep for 0.2 second and try again |
|
|
|
// If we failed to fetch the tokens, sleep for 0.2 second and try again |
|
|
|
usleep(200000); |
|
|
|
usleep(200000); |
|
|
|
} |
|
|
|
} |
|
|
|
assert(file_exists(PRIMARY_TOKEN_FILE) || |
|
|
|
assert(file_exists(PRIMARY_TOKEN_FILE) || |
|
|
|
file_exists(SECONDARY_TOKEN_FILE)); |
|
|
|
file_exists($cwd_token_file)); |
|
|
|
|
|
|
|
|
|
|
|
// Try the primary location first, followed by a secondary. |
|
|
|
// Try the primary location first, followed by a secondary. |
|
|
|
if (file_exists(PRIMARY_TOKEN_FILE)) { |
|
|
|
if (file_exists(PRIMARY_TOKEN_FILE)) { |
|
|
|
$cmd = 'cat ' . PRIMARY_TOKEN_FILE; |
|
|
|
$cmd = 'cat ' . PRIMARY_TOKEN_FILE; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$cmd = 'cat ' . SECONDARY_TOKEN_FILE; |
|
|
|
$cmd = 'cat ' . $cwd_token_file; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
assert(strlen($cmd) > 0); |
|
|
|
assert(strlen($cmd) > 0); |
|
|
@ -305,7 +301,7 @@ function getSandcastleConfig() { |
|
|
|
// Submit to Sandcastle. |
|
|
|
// Submit to Sandcastle. |
|
|
|
$url = 'https://interngraph.intern.facebook.com/sandcastle/generate?' |
|
|
|
$url = 'https://interngraph.intern.facebook.com/sandcastle/generate?' |
|
|
|
.'command=SandcastleUniversalCommand' |
|
|
|
.'command=SandcastleUniversalCommand' |
|
|
|
.'&vcs=rocksdb-git&revision=origin%2Fmaster&type=lego' |
|
|
|
.'&vcs=rocksdb-int-git&revision=origin%2Fmaster&type=lego' |
|
|
|
.'&user=' . $username . '&alias=rocksdb-precommit' |
|
|
|
.'&user=' . $username . '&alias=rocksdb-precommit' |
|
|
|
.'&command-args=' . urlencode(json_encode($command)); |
|
|
|
.'&command-args=' . urlencode(json_encode($command)); |
|
|
|
|
|
|
|
|
|
|
@ -315,7 +311,7 @@ function getSandcastleConfig() { |
|
|
|
$app = $sandcastle_config[0]; |
|
|
|
$app = $sandcastle_config[0]; |
|
|
|
$token = $sandcastle_config[1]; |
|
|
|
$token = $sandcastle_config[1]; |
|
|
|
|
|
|
|
|
|
|
|
$cmd = 'https_proxy= HTTPS_PROXY= curl -s -k -F app=' . $app . ' ' |
|
|
|
$cmd = 'curl -s -k -F app=' . $app . ' ' |
|
|
|
. '-F token=' . $token . ' "' . $url . '"'; |
|
|
|
. '-F token=' . $token . ' "' . $url . '"'; |
|
|
|
|
|
|
|
|
|
|
|
$output = shell_exec($cmd); |
|
|
|
$output = shell_exec($cmd); |
|
|
|