mirror of
https://github.com/deployphp/deployer.git
synced 2025-01-17 21:48:58 +01:00
Delete deploy.yaml
This commit is contained in:
parent
75a1f8e6d8
commit
d7afe5681d
21
deploy.yaml
21
deploy.yaml
@ -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
|
@ -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);
|
||||
});
|
@ -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");
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user