structure for autodeployment
This commit is contained in:
27
.deployment/create_info_json.php
Normal file
27
.deployment/create_info_json.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
if (!isset($argv[1])) {
|
||||
die('No version set, please use ' . PHP_EOL .'make setup version=' . PHP_EOL);
|
||||
}
|
||||
$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;
|
||||
}
|
Reference in New Issue
Block a user