Skip to content

Commit ec34133

Browse files
committed
Revert "Release v7.5.3"
This reverts commit 12e99f9.
1 parent 12e99f9 commit ec34133

File tree

649 files changed

+103313
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

649 files changed

+103313
-0
lines changed

.github/workflows/docker.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
env:
3434
VERSION: ${{ inputs.version }}
3535

36+
- name: Build phar
37+
run: php -d phar.readonly=0 bin/build -v"$RELEASE_VERSION"
38+
3639
- name: Set up Docker Buildx
3740
uses: docker/setup-buildx-action@v3
3841

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
env:
2828
VERSION: ${{ inputs.version }}
2929

30+
- name: Build phar
31+
run: php -d phar.readonly=0 bin/build -v"$RELEASE_VERSION"
32+
3033
- name: Sign phar
3134
run: |
3235
mkdir -p ~/.gnupg/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
deployer.phar
12
.phpunit.result.cache
23
docker-compose.override.yml
34
.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
$finder = (new PhpCsFixer\Finder())
4+
->in(__DIR__ . '/src')
5+
->in(__DIR__ . '/recipe')
6+
->in(__DIR__ . '/contrib')
7+
->in(__DIR__ . '/tests');
8+
9+
return (new PhpCsFixer\Config())
10+
->setRules([
11+
'@PER-CS' => true,
12+
])
13+
->setFinder($finder);

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM php:8.3-cli-alpine
2+
3+
RUN apk add --no-cache bash git openssh-client rsync
4+
5+
COPY deployer.phar /bin/deployer.phar
6+
7+
WORKDIR /app
8+
9+
ENTRYPOINT ["php", "/bin/deployer.phar"]

bin/build

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#!/usr/bin/env php
2+
<?php
3+
/* (c) Anton Medvedev <[email protected]>
4+
*
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*/
8+
if (ini_get('phar.readonly') === '1') {
9+
throw new \Exception('Writing to phar files is disabled. Change your `php.ini` or append `-d phar.readonly=false` to the shebang, if supported by your `env` executable.');
10+
}
11+
12+
define('__ROOT__', realpath(__DIR__ . '/..'));
13+
chdir(__ROOT__);
14+
15+
$opt = getopt('v:', ['nozip']);
16+
17+
$version = $opt['v'] ?? null;
18+
if (empty($version)) {
19+
echo "Please, specify version as \"-v8.0.0\".\n";
20+
exit(1);
21+
}
22+
if (!preg_match('/^\d+\.\d+\.\d+(\-\w+(\.\d+)?)?$/', $version)) {
23+
echo "Version must be \"7.0.0-beta.42\". Got \"$version\".\n";
24+
exit(1);
25+
}
26+
27+
$pharName = "deployer.phar";
28+
$pharFile = __ROOT__ . '/' . $pharName;
29+
if (file_exists($pharFile)) {
30+
unlink($pharFile);
31+
}
32+
33+
$ignore = [
34+
'.anton',
35+
'.git',
36+
'Tests',
37+
'tests',
38+
'deploy.php',
39+
'.php-cs-fixer.dist.php',
40+
];
41+
42+
$phar = new \Phar($pharFile, 0, $pharName);
43+
$phar->setSignatureAlgorithm(\Phar::SHA1);
44+
$phar->startBuffering();
45+
$iterator = new RecursiveDirectoryIterator(__ROOT__, FilesystemIterator::SKIP_DOTS);
46+
$iterator = new RecursiveCallbackFilterIterator($iterator, function (SplFileInfo $fileInfo) use ($ignore) {
47+
return !in_array($fileInfo->getBasename(), $ignore, true);
48+
});
49+
$iterator = new RecursiveIteratorIterator($iterator);
50+
$iterator = new CallbackFilterIterator($iterator, function (SplFileInfo $fileInfo) {
51+
//'bash', 'fish', 'zsh' is a completion templates
52+
return in_array($fileInfo->getExtension(), ['php', 'exe', 'bash', 'fish', 'zsh'], true);
53+
});
54+
55+
foreach ($iterator as $fileInfo) {
56+
$file = str_replace(__ROOT__, '', $fileInfo->getRealPath());
57+
echo "+ " . $file . "\n";
58+
$phar->addFile($fileInfo->getRealPath(), $file);
59+
60+
if (!array_key_exists('nozip', $opt)) {
61+
$phar[$file]->compress(Phar::GZ);
62+
63+
if (!$phar[$file]->isCompressed()) {
64+
echo "Could not compress File: $file\n";
65+
}
66+
}
67+
}
68+
69+
// Add schema.json
70+
echo "+ /src/schema.json\n";
71+
$phar->addFile(realpath(__DIR__ . '/../src/schema.json'), '/src/schema.json');
72+
73+
// Add Caddyfile
74+
echo "+ /recipe/provision/Caddyfile\n";
75+
$phar->addFile(realpath(__DIR__ . '/../recipe/provision/Caddyfile'), '/recipe/provision/Caddyfile');
76+
77+
// Add 404.html
78+
echo "+ /recipe/provision/404.html\n";
79+
$phar->addFile(realpath(__DIR__ . '/../recipe/provision/404.html'), '/recipe/provision/404.html');
80+
81+
// Add bin/dep file
82+
echo "+ /bin/dep\n";
83+
$depContent = file_get_contents(__ROOT__ . '/bin/dep');
84+
$depContent = str_replace("#!/usr/bin/env php\n", '', $depContent);
85+
$depContent = str_replace('__FILE__', 'str_replace("phar://", "", Phar::running())', $depContent);
86+
$depContent = preg_replace("/run\('.+?'/", "run('$version'", $depContent);
87+
$phar->addFromString('bin/dep', $depContent);
88+
89+
$phar->setStub(
90+
<<<STUB
91+
#!/usr/bin/env php
92+
<?php
93+
Phar::mapPhar('{$pharName}');
94+
require 'phar://{$pharName}/bin/dep';
95+
__HALT_COMPILER();
96+
STUB
97+
);
98+
$phar->stopBuffering();
99+
unset($phar);
100+
101+
echo "$pharName was created successfully.\n";

bin/dep

-771 KB
Binary file not shown.

bin/docgen

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env php
2+
<?php
3+
/* (c) Anton Medvedev <[email protected]>
4+
*
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*/
8+
9+
namespace Deployer;
10+
11+
use Deployer\Documentation\ApiGen;
12+
use Deployer\Documentation\DocGen;
13+
use Symfony\Component\Console\Application;
14+
use Symfony\Component\Console\Input\ArgvInput;
15+
use Symfony\Component\Console\Output\ConsoleOutput;
16+
17+
require __DIR__ . '/../vendor/autoload.php';
18+
19+
chdir(realpath(__DIR__ . '/..'));
20+
21+
$input = new ArgvInput();
22+
$output = new ConsoleOutput();
23+
$app = new Application('DocGen', '1.0.0');
24+
$app->setDefaultCommand('all');
25+
26+
$api = function () use ($output) {
27+
$parser = new ApiGen();
28+
$parser->parse(file_get_contents(__DIR__ . '/../src/functions.php'));
29+
$md = $parser->markdown();
30+
file_put_contents(__DIR__ . '/../docs/api.md', $md);
31+
$output->writeln('API Reference documentation updated.');
32+
};
33+
34+
$recipes = function () use ($input, $output) {
35+
$docgen = new DocGen(__DIR__ . '/..');
36+
$docgen->parse(__DIR__ . '/../recipe');
37+
$docgen->parse(__DIR__ . '/../contrib');
38+
39+
if ($input->getOption('json')) {
40+
echo json_encode($docgen->recipes, JSON_PRETTY_PRINT);
41+
return;
42+
}
43+
44+
$docgen->gen(__DIR__ . '/../docs');
45+
$output->writeln('Recipes documentation updated.');
46+
};
47+
48+
$app->register('api')->setCode($api);
49+
$app->register('recipes')->setCode($recipes)->addOption('json');
50+
$app->register('all')->setCode(function () use ($recipes, $api) {
51+
$api();
52+
$recipes();
53+
echo `git status`;
54+
})->addOption('json');
55+
56+
$app->run($input, $output);

composer.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,44 @@
2020
"url": "https://github.com/sponsors/antonmedv"
2121
}
2222
],
23+
"autoload": {
24+
"psr-4": {
25+
"Deployer\\": "src/"
26+
},
27+
"files": [
28+
"vendor/autoload.php",
29+
"src/Support/helpers.php",
30+
"src/functions.php"
31+
]
32+
},
33+
"scripts": {
34+
"test": "pest",
35+
"test:e2e": "pest --config tests/e2e/phpunit-e2e.xml",
36+
"check": "php-cs-fixer check",
37+
"fix": "php-cs-fixer fix",
38+
"phpstan": "phpstan analyse -c phpstan.neon --memory-limit 1G",
39+
"phpstan:baseline": "@phpstan --generate-baseline tests/phpstan-baseline.neon"
40+
},
2341
"bin": [
2442
"bin/dep"
2543
],
2644
"require": {
2745
"php": "^8.0|^7.3",
2846
"ext-json": "*"
47+
},
48+
"require-dev": {
49+
"friendsofphp/php-cs-fixer": "^3.64",
50+
"pestphp/pest": "^3.3",
51+
"phpstan/phpstan": "^1.4",
52+
"phpunit/php-code-coverage": "^11.0",
53+
"phpunit/phpunit": "^11.4"
54+
},
55+
"config": {
56+
"sort-packages": true,
57+
"process-timeout": 0,
58+
"allow-plugins": {
59+
"pestphp/pest-plugin": true,
60+
"dealerdirect/phpcodesniffer-composer-installer": true
61+
}
2962
}
3063
}

0 commit comments

Comments
 (0)