-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.php
More file actions
37 lines (33 loc) · 1.03 KB
/
scripts.php
File metadata and controls
37 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
declare(strict_types=1);
return function ($io): \Generator {
$version = $io->choice(
'Select PHP Version',
[
'8.3',
'8.2',
],
0
);
$version = 'php' . $version;
$image = $io->ask('Image Name', 'username/your-image');
$host = $io->ask('Host', 'mager-symfony.com');
yield <<<CMD
sed -i 's/{\$input.image}/{$image}/g' mager.yaml
sed -i 's/{\$input.host}/{$host}/g' mager.yaml
sed -i 's/{\$input.host}/{$host}/g' mager.dev.yaml
sed -i 's/{\$input.php-version}/{$version}/g' Dockerfile"
CMD;
$composerCommand = <<<SCRIPT
composer require runtime/frankenphp-symfony
composer config --json extra.symfony.docker 'true'
SCRIPT;
if (file_exists('./composer.json')) {
try {
yield $composerCommand;
} catch (\Exception) {
$io->warning('Composer not installed yet, please run this following command manually');
$io->writeln($composerCommand);
}
}
};