File tree Expand file tree Collapse file tree 2 files changed +31
-9
lines changed Expand file tree Collapse file tree 2 files changed +31
-9
lines changed Original file line number Diff line number Diff line change 11import :
2+ - src/Support/update_banner.php
23 - src/Support/update_manifest.php
34
45hosts :
78
89config :
910 banner : |
10- ╭──────────────────────────────────────────────────────╮
11- │ │
12- │ Update available! Mode info ï.at/update │
13- │ │
14- ╰──────────────────────────────────────────────────────╯
11+ ╭────────────────────────────────────────────╮
12+ │ │
13+ │ Update available! More info at │
14+ │ https://ï.at/deployer-releases │
15+ │ │
16+ ╰────────────────────────────────────────────╯
1517
1618tasks :
1719 release :
20+ - update_banner
1821 - update_manifest
19-
20- create_banner :
21- - desc : Create an update banner
22- - run : echo $'{{banner}}' > {{site}}/check-updates/{{old_version}}
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ /* (c) Anton Medvedev <anton@medv.io>
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+ task ('update_banner ' , function () {
12+ $ skipCurrentVersion = get ('version ' );
13+ $ manifestPath = '~/deployer.org/artifacts/manifest.json ' ;
14+ $ manifest = json_decode (run ("cat $ manifestPath " ), true );
15+ $ commands = '' ;
16+ foreach ($ manifest as $ m ) {
17+ if ($ skipCurrentVersion === $ m ['version ' ]) {
18+ continue ;
19+ }
20+ $ commands .= "echo -n '{{banner}}' > ~/deployer.org/check-updates/ {$ m ['version ' ]}; \n" ;
21+ }
22+ run ($ commands );
23+ });
You can’t perform that action at this time.
0 commit comments