Skip to content

Commit 29a8fc4

Browse files
committed
Case 27689; Added new base configure command.
1 parent ec55fb6 commit 29a8fc4

File tree

5 files changed

+76
-0
lines changed

5 files changed

+76
-0
lines changed

chain/chain-site-build-vm.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Usage: drupal site:build --placeholder="name:subscriptions"
2+
command:
3+
name: site:build
4+
description: 'Builds a site.'
5+
commands:
6+
# We must ensure we run this command first in all chains to setup our console environment.
7+
- command: site:base:setup
8+
arguments:
9+
name: '%{{name}}'
10+
# Checkout site
11+
- command: site:checkout
12+
arguments:
13+
name: '%{{name}}'
14+
options:
15+
branch: '%{{branch|8.x}}'
16+
# Run site:rebuild
17+
- command: site:rebuild
18+
options:
19+
placeholder:
20+
- 'name:%{{name}}'
21+
22+
- command: exec
23+
arguments:
24+
bin: 'drupal site:build:${{env}} --placeholder="name=%{{name}}";'

chain/chain-site-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ command:
33
name: site:test
44
description: 'Sets the test suites up and then runs them.'
55
commands:
6+
# We must ensure we run this command first in all chains to setup our console environment.
7+
- command: site:base:setup
8+
arguments:
9+
name: '%{{name}}'
610
# Set up testing suites
711
- command: site:test:setup
812
arguments:

chain/chain-site-update.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ command:
33
name: site:update
44
description: 'Sets the site up based on current configuration and database.'
55
commands:
6+
# We must ensure we run this command first in all chains to setup our console environment.
7+
- command: site:base:setup
8+
arguments:
9+
name: '%{{name}}'
610
# Set default drush alias.
711
- command: exec
812
arguments:

console.config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ application:
22
autowire:
33
commands:
44
forced:
5+
'site:base:setup':
6+
class: \DennisDigital\Drupal\Console\Command\SiteSetupCommand
57
'site:checkout':
68
class: \DennisDigital\Drupal\Console\Command\SiteCheckoutCommand
79
'site:compose':

src/Command/SiteSetupCommand.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
/**
4+
* @file
5+
* Contains \DennisDigital\Drupal\Console\Command\SiteSetupCommand.
6+
*
7+
* Sets up the necessary site variables.
8+
*/
9+
10+
namespace DennisDigital\Drupal\Console\Command;
11+
12+
use Symfony\Component\Console\Input\InputInterface;
13+
use Symfony\Component\Console\Output\OutputInterface;
14+
use DennisDigital\Drupal\Console\Exception\SiteCommandException;
15+
16+
/**
17+
* Class SiteSetupCommand
18+
*
19+
* @package DennisDigital\Drupal\Console\Command
20+
*/
21+
class SiteSetupCommand extends SiteBaseCommand {
22+
23+
/**
24+
* {@inheritdoc}
25+
*/
26+
protected function configure() {
27+
parent::configure();
28+
29+
$this->setName('site:base:setup')
30+
// @todo use: ->setDescription($this->trans('commands.site.compose.description'))
31+
->setDescription('Sets up the necessary site variables.');
32+
}
33+
34+
/**
35+
* {@inheritdoc}
36+
*/
37+
protected function execute(InputInterface $input, OutputInterface $output) {
38+
parent::execute($input, $output);
39+
40+
$this->io->success('Stuff works.');
41+
}
42+
}

0 commit comments

Comments
 (0)