Delete deploy.yaml

This commit is contained in:
Anton Medvedev 2023-04-05 10:09:24 +02:00
parent 75a1f8e6d8
commit d7afe5681d
No known key found for this signature in database
3 changed files with 0 additions and 85 deletions

View File

@ -1,21 +0,0 @@
import:
- src/Support/update_banner.php
- src/Support/update_manifest.php
hosts:
deployer.org:
remote_user: anton
config:
banner: |
╭────────────────────────────────────────────╮
│ │
│ Update available! More info at │
│ https://ï.at/deployer-releases │
│ │
╰────────────────────────────────────────────╯
tasks:
release:
- update_banner
- update_manifest

View File

@ -1,23 +0,0 @@
<?php declare(strict_types=1);
/* (c) Anton Medvedev <anton@medv.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Deployer;
task('update_banner', function () {
$skipCurrentVersion = get('version');
$manifestPath = '~/deployer.org/artifacts/manifest.json';
$manifest = json_decode(run("cat $manifestPath"), true);
$commands = '';
foreach ($manifest as $m) {
if ($skipCurrentVersion === $m['version']) {
continue;
}
$commands .= "echo -n '{{banner}}' > ~/deployer.org/check-updates/{$m['version']};\n";
}
run($commands);
});

View File

@ -1,41 +0,0 @@
<?php declare(strict_types=1);
/* (c) Anton Medvedev <anton@medv.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Deployer;
task('update_manifest', function () {
$version = get('version');
$manifestPath = '~/deployer.org/artifacts/manifest.json';
$manifest = json_decode(run("cat $manifestPath"), true);
$newPharManifest = [
'name' => 'deployer.phar',
'sha1' => get('sha1'),
'url' => "https://github.com/deployphp/deployer/releases/download/v$version/deployer.phar",
'version' => $version,
];
// Check if this version already in manifest.json.
$alreadyExistVersion = null;
foreach ($manifest as $i => $m) {
if ($m['version'] === $version) {
$alreadyExistVersion = $i;
}
}
// Save or update.
if (empty($alreadyExistVersion)) {
$manifest[] = $newPharManifest;
} else {
$manifest[$alreadyExistVersion] = $newPharManifest;
}
// Write manifest to manifest.json.
$content = json_encode($manifest, JSON_PRETTY_PRINT);
run("echo '$content' > $manifestPath");
});