1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-08 16:02:39 +01:00

Put a Phage skeleton command on the Arcanist experimental branch

Summary:
Ref T2794. This doesn't do anything useful, but since I'm planning to start using this stuff to do real deployments I don't want to lose it if my laptop gets hit by a bus.

This just adds a skeletal `bin/phage` with enough code that I can add actual workflows to Phacility repositories and get `bin/phage remote --hosts ...` working without the code only existing on my laptop.

Test Plan: Ran `bin/phage`, saw nothin'.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T2794

Differential Revision: https://secure.phabricator.com/D17379
This commit is contained in:
epriestley 2017-02-07 07:09:23 -08:00
parent 84857e4890
commit dc65bfbe54
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

@ -437,6 +437,7 @@ phutil_register_library_map(array(
'ArcanistXUnitTestResultParser' => 'unit/parser/ArcanistXUnitTestResultParser.php', 'ArcanistXUnitTestResultParser' => 'unit/parser/ArcanistXUnitTestResultParser.php',
'CSharpToolsTestEngine' => 'unit/engine/CSharpToolsTestEngine.php', 'CSharpToolsTestEngine' => 'unit/engine/CSharpToolsTestEngine.php',
'NoseTestEngine' => 'unit/engine/NoseTestEngine.php', 'NoseTestEngine' => 'unit/engine/NoseTestEngine.php',
'PhageWorkflow' => 'phage/workflow/PhageWorkflow.php',
'PhpunitTestEngine' => 'unit/engine/PhpunitTestEngine.php', 'PhpunitTestEngine' => 'unit/engine/PhpunitTestEngine.php',
'PhpunitTestEngineTestCase' => 'unit/engine/__tests__/PhpunitTestEngineTestCase.php', 'PhpunitTestEngineTestCase' => 'unit/engine/__tests__/PhpunitTestEngineTestCase.php',
'PhutilTestCase' => 'unit/engine/phutil/PhutilTestCase.php', 'PhutilTestCase' => 'unit/engine/phutil/PhutilTestCase.php',
@ -879,6 +880,7 @@ phutil_register_library_map(array(
'ArcanistXUnitTestResultParser' => 'Phobject', 'ArcanistXUnitTestResultParser' => 'Phobject',
'CSharpToolsTestEngine' => 'XUnitTestEngine', 'CSharpToolsTestEngine' => 'XUnitTestEngine',
'NoseTestEngine' => 'ArcanistUnitTestEngine', 'NoseTestEngine' => 'ArcanistUnitTestEngine',
'PhageWorkflow' => 'PhutilArgumentWorkflow',
'PhpunitTestEngine' => 'ArcanistUnitTestEngine', 'PhpunitTestEngine' => 'ArcanistUnitTestEngine',
'PhpunitTestEngineTestCase' => 'PhutilTestCase', 'PhpunitTestEngineTestCase' => 'PhutilTestCase',
'PhutilTestCase' => 'Phobject', 'PhutilTestCase' => 'Phobject',

View file

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