2024-03-02 18:14:08 +01:00
|
|
|
<?php
|
|
|
|
if (!isset($argv[1])) {
|
2024-06-01 11:27:32 +02:00
|
|
|
die('No version set, please use ' . PHP_EOL .'make deploy version=' . PHP_EOL);
|
2024-03-02 18:14:08 +01:00
|
|
|
}
|
|
|
|
$file = file_get_contents(dirname(__FILE__) . '/info.json.tpl');
|
|
|
|
$file = str_replace('%version%', $argv[1], $file);
|
|
|
|
$file = str_replace('%date%', date('d.m.Y H:i:00'), $file);
|
|
|
|
$file = str_replace('%changelog%', parseChangeLog(), $file);
|
|
|
|
|
|
|
|
$ptr = fopen('info.json', 'w');
|
|
|
|
fwrite($ptr, $file);
|
|
|
|
fclose($ptr);
|
|
|
|
|
|
|
|
|
|
|
|
system('lftp -e "put -O / info.json; bye" -u "lv-sachsen-main_ftp3,sE&xDXc8za#S" bdp.mein-verein.online');
|
|
|
|
function parseChangeLog()
|
|
|
|
{
|
|
|
|
$return = '';
|
|
|
|
foreach (file(dirname(__FILE__) . '/../changelog') as $line) {
|
|
|
|
$line = trim($line);
|
|
|
|
if ($line !== '') {
|
|
|
|
$return .= $line;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
return $return;
|
|
|
|
}
|