Added docker option for FWest98

Use as: `release.php --docker`
This commit is contained in:
djmaze 2020-11-30 18:58:20 +01:00
parent 0173d30619
commit 4d0276bb09

View file

@ -7,6 +7,9 @@ if (!$gulp) {
exit('gulp not installed, run as root: npm install --global gulp-cli');
}
$options = getopt('', ['docker']);
$options['docker'] = isset($options['docker']);
$package = json_decode(file_get_contents('package.json'));
$zip_destination = "snappymail-{$package->version}.zip";
@ -71,7 +74,11 @@ foreach ($files as $file) {
}
}
$tar->buildFromDirectory('./snappymail/', "@v/{$package->version}@");
if ($options['docker']) {
$tar->buildFromDirectory('./snappymail/', "@v/{$package->version}@");
} else {
$tar->buildFromDirectory('./', "@snappymail/v/{$package->version}@");
}
$zip->addFile('data/.htaccess');
$tar->addFile('data/.htaccess');
@ -122,4 +129,4 @@ if(readline("Build Docker image? (Y/N): ") === "Y") {
}
passthru("{$docker} build " . __DIR__ . "/.docker/release/ --build-arg FILES_ZIP={$zip_destination} -t snappymail:{$package->version}");
}
}