Skip to content

Commit 839741a

Browse files
committed
Add support for deploy.maml and make schema method static
1 parent 1356983 commit 839741a

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

bin/dep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ $lookUp = function (string $name): ?string {
4545
if (empty($deployFile)) {
4646
$deployFile = $lookUp('deploy.php');
4747
}
48+
if (empty($deployFile)) {
49+
$deployFile = $lookUp('deploy.maml');
50+
}
4851
if (empty($deployFile)) {
4952
$deployFile = $lookUp('deploy.yaml');
5053
}

src/Import/MamlRecipe.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
namespace Deployer\Import;
1212

13-
use Deployer\Exception\ConfigurationException;
1413
use Deployer\Exception\Exception;
1514
use Deployer\Exception\SchemaException;
1615
use Maml\Ast\ArrayNode;
@@ -48,7 +47,7 @@ public function __construct(string $path)
4847
$this->content = file_get_contents($path, true);
4948
}
5049

51-
private function schema(): SchemaType
50+
public static function schema(): SchemaType
5251
{
5352
$cd = S::object([
5453
'cd' => S::string(),
@@ -158,7 +157,7 @@ public function run(): void
158157
{
159158
$recipe = Maml::parseAst($this->content);
160159

161-
$validationErrors = Maml::validate($recipe, $this->schema());
160+
$validationErrors = Maml::validate($recipe, self::schema());
162161

163162
$exception = null;
164163
foreach ($validationErrors as $error) {

0 commit comments

Comments
 (0)