-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
63 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,72 @@ | ||
<?php | ||
|
||
use Castor\Attribute\AsContext; | ||
use Castor\Attribute\AsTask; | ||
use Castor\Context; | ||
|
||
use function Castor\run; | ||
|
||
#[AsContext(default: true)] | ||
function context(): Context | ||
#[AsTask()] | ||
function ansi_false_false() | ||
{ | ||
$c = new Context( | ||
pty: false, | ||
tty: false, | ||
); | ||
run(['docker', 'compose', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', 'stop'], context: $c); | ||
} | ||
|
||
#[AsTask()] | ||
function ansi_true_false() | ||
{ | ||
$c = new Context( | ||
pty: true, | ||
tty: false, | ||
); | ||
run(['docker', 'compose', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', 'stop'], context: $c); | ||
} | ||
|
||
#[AsTask()] | ||
function ansi_false_true() | ||
{ | ||
return new Context( | ||
// pty: false, | ||
// tty: false, | ||
$c = new Context( | ||
pty: true, | ||
tty: false, | ||
); | ||
run(['docker', 'compose', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', 'stop'], context: $c); | ||
} | ||
|
||
#[AsTask()] | ||
function ansi() | ||
function no_ansi_false_false() | ||
{ | ||
run(['docker', 'compose', 'up', '-d']); | ||
run(['docker', 'compose', 'stop']); | ||
$c = new Context( | ||
pty: false, | ||
tty: false, | ||
); | ||
run(['docker', 'compose', '--ansi=never', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', '--ansi=never', 'stop'], context: $c); | ||
} | ||
|
||
#[AsTask()] | ||
function no_ansi() | ||
function no_ansi_true_false() | ||
{ | ||
run(['docker', 'compose', '--ansi=never', 'up', '-d']); | ||
run(['docker', 'compose', '--ansi=never', 'stop']); | ||
$c = new Context( | ||
pty: true, | ||
tty: false, | ||
); | ||
run(['docker', 'compose', '--ansi=never', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', '--ansi=never', 'stop'], context: $c); | ||
} | ||
|
||
#[AsTask()] | ||
function no_ansi_false_true() | ||
{ | ||
$c = new Context( | ||
pty: true, | ||
tty: false, | ||
); | ||
run(['docker', 'compose', '--ansi=never', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', '--ansi=never', 'stop'], context: $c); | ||
} |