1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-28 09:42:40 +01:00

Merge "phage" from "experimental"

Summary: Ref T13395. Currently, "phage" is required for various cluster operations. Bring the working code out of "experimental". This isn't the final form; "wilds" has a fancier version.

Test Plan: Ran phage workflows against the cluster.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20982
This commit is contained in:
epriestley 2020-02-12 15:43:12 -08:00
parent 9b74cb4ee6
commit 61e059984a
4 changed files with 42 additions and 0 deletions

1
bin/phage Symbolic link
View file

@ -0,0 +1 @@
../scripts/phage.php

29
scripts/phage.php Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
require_once dirname(__FILE__).'/__init_script__.php';
ini_set('memory_limit', -1);
$args = new PhutilArgumentParser($argv);
$args->parseStandardArguments();
$args->parsePartial(array());
// TODO: This is pretty minimal and should be shared with "arc".
$working_directory = getcwd();
$working_copy = ArcanistWorkingCopyIdentity::newFromPath($working_directory);
$config = id(new ArcanistConfigurationManager())
->setWorkingCopyIdentity($working_copy);
foreach ($config->getProjectConfig('load') as $load) {
$load = Filesystem::resolvePath($working_copy->getProjectRoot().'/'.$load);
phutil_load_library($load);
}
$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhageWorkflow')
->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);

View file

@ -473,6 +473,7 @@ phutil_register_library_map(array(
'PhagePHPAgent' => 'phage/agent/PhagePHPAgent.php', 'PhagePHPAgent' => 'phage/agent/PhagePHPAgent.php',
'PhagePHPAgentBootloader' => 'phage/bootloader/PhagePHPAgentBootloader.php', 'PhagePHPAgentBootloader' => 'phage/bootloader/PhagePHPAgentBootloader.php',
'PhagePlanAction' => 'phage/action/PhagePlanAction.php', 'PhagePlanAction' => 'phage/action/PhagePlanAction.php',
'PhageWorkflow' => 'phage/workflow/PhageWorkflow.php',
'Phobject' => 'object/Phobject.php', 'Phobject' => 'object/Phobject.php',
'PhobjectTestCase' => 'object/__tests__/PhobjectTestCase.php', 'PhobjectTestCase' => 'object/__tests__/PhobjectTestCase.php',
'PhpunitTestEngine' => 'unit/engine/PhpunitTestEngine.php', 'PhpunitTestEngine' => 'unit/engine/PhpunitTestEngine.php',
@ -1348,6 +1349,7 @@ phutil_register_library_map(array(
'PhagePHPAgent' => 'Phobject', 'PhagePHPAgent' => 'Phobject',
'PhagePHPAgentBootloader' => 'PhageAgentBootloader', 'PhagePHPAgentBootloader' => 'PhageAgentBootloader',
'PhagePlanAction' => 'PhageAction', 'PhagePlanAction' => 'PhageAction',
'PhageWorkflow' => 'PhutilArgumentWorkflow',
'Phobject' => 'Iterator', 'Phobject' => 'Iterator',
'PhobjectTestCase' => 'PhutilTestCase', 'PhobjectTestCase' => 'PhutilTestCase',
'PhpunitTestEngine' => 'ArcanistUnitTestEngine', 'PhpunitTestEngine' => 'ArcanistUnitTestEngine',

View file

@ -0,0 +1,10 @@
<?php
abstract class PhageWorkflow
extends PhutilArgumentWorkflow {
public function isExecutable() {
return true;
}
}