mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Merge branch 'task/naderman/phing-build' into develop-olympus
* task/naderman/phing-build: [task/phing-build] Automatically trigger build_diff [task/phing-build] Added a build.xml configuration for phing.
This commit is contained in:
commit
2e5217f773
4 changed files with 183 additions and 324 deletions
149
build/build.xml
Normal file
149
build/build.xml
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
|
||||||
|
<!-- a few settings for the build -->
|
||||||
|
<property name="newversion" value="3.0.8" />
|
||||||
|
<property name="prevversion" value="3.0.7-PL1" />
|
||||||
|
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6" />
|
||||||
|
<!-- no configuration should be needed beyond this point -->
|
||||||
|
|
||||||
|
<property name="oldversions" value="${olderversions}, ${prevversion}" />
|
||||||
|
<property name="versions" value="${oldversions}, ${newversion}" />
|
||||||
|
|
||||||
|
<!-- These are the main targets which you will probably want to use -->
|
||||||
|
<target name="package" depends="clean,prepare,create-package" />
|
||||||
|
<target name="all" depends="clean,prepare,test,create-package" />
|
||||||
|
|
||||||
|
<target name="prepare">
|
||||||
|
<mkdir dir="build/logs" />
|
||||||
|
<mkdir dir="build/api" />
|
||||||
|
<mkdir dir="build/codebrowser" />
|
||||||
|
<mkdir dir="build/coverage" />
|
||||||
|
<mkdir dir="build/cpd" />
|
||||||
|
<mkdir dir="build/dependencies" />
|
||||||
|
<mkdir dir="build/new_version" />
|
||||||
|
<mkdir dir="build/new_version/files" />
|
||||||
|
<mkdir dir="build/new_version/patches" />
|
||||||
|
<mkdir dir="build/new_version/release_files" />
|
||||||
|
<mkdir dir="build/new_version/update" />
|
||||||
|
<mkdir dir="build/old_versions" />
|
||||||
|
<mkdir dir="build/save" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="clean">
|
||||||
|
<delete dir="build/logs" />
|
||||||
|
<delete dir="build/api" />
|
||||||
|
<delete dir="build/codebrowser" />
|
||||||
|
<delete dir="build/coverage" />
|
||||||
|
<delete dir="build/cpd" />
|
||||||
|
<delete dir="build/dependencies" />
|
||||||
|
<delete dir="build/new_version" />
|
||||||
|
<delete dir="build/old_versions" />
|
||||||
|
<delete dir="build/save" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="test">
|
||||||
|
<exec dir="tests"
|
||||||
|
command="phpunit --log-junit ../build/logs/phpunit.xml
|
||||||
|
--coverage-clover ../build/logs/clover.xml
|
||||||
|
--coverage-html ../build/coverage
|
||||||
|
phpbb_all_tests all_tests.php"
|
||||||
|
passthru="true" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Does not allow changing the working directory to tests/
|
||||||
|
so this approach does not work for us unfortunately
|
||||||
|
<phpunit codecoverage="true" haltonfailure="true">
|
||||||
|
<formatter todir="build/logs" type="xml"/>
|
||||||
|
<batchtest>
|
||||||
|
<fileset dir="tests">
|
||||||
|
<include name="all_tests.php"/>
|
||||||
|
</fileset>
|
||||||
|
</batchtest>
|
||||||
|
</phpunit>
|
||||||
|
-->
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="old-version-diffs">
|
||||||
|
<foreach list="${oldversions}" param="version" target="old-version-diff" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- This target retrieves an old version from the git tag release-${version}
|
||||||
|
and creates a diff between that release and the new one -->
|
||||||
|
<target name="old-version-diff">
|
||||||
|
<echo msg="Retrieving version ${version}" />
|
||||||
|
<mkdir dir="build/old_versions/release-${version}" />
|
||||||
|
|
||||||
|
<phingcall target="export">
|
||||||
|
<property name="revision" value="release-${version}" />
|
||||||
|
<property name="dir" value="build/old_versions/release-${version}" />
|
||||||
|
</phingcall>
|
||||||
|
|
||||||
|
<phingcall target="clean-diff-dir">
|
||||||
|
<property name="dir" value="build/old_versions/release-${version}" />
|
||||||
|
</phingcall>
|
||||||
|
|
||||||
|
<exec dir="build/old_versions" command="diff -crNEBwd release-${version} release-${newversion} >
|
||||||
|
../new_version/patches/phpBB-${version}_to_${newversion}.patch" escape="false" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="prepare-new-version">
|
||||||
|
<!-- select the currently checked out commit (HEAD) for packaging -->
|
||||||
|
<mkdir dir="build/new_version/phpBB3" />
|
||||||
|
<phingcall target="export">
|
||||||
|
<property name="revision" value="HEAD" />
|
||||||
|
<property name="dir" value="build/new_version/phpBB3" />
|
||||||
|
</phingcall>
|
||||||
|
|
||||||
|
<!-- copy into directory for diffs -->
|
||||||
|
<exec dir="build" command="cp -rp new_version/phpBB3 old_versions/release-${newversion}" />
|
||||||
|
<!-- and clean up -->
|
||||||
|
<phingcall target="clean-diff-dir">
|
||||||
|
<property name="dir" value="build/old_versions/release-${newversion}" />
|
||||||
|
</phingcall>
|
||||||
|
|
||||||
|
<!-- create an empty config.php file (not for diffs) -->
|
||||||
|
<touch file="build/new_version/phpBB3/config.php" />
|
||||||
|
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="create-package" depends="prepare-new-version,old-version-diffs">
|
||||||
|
<exec dir="build" command="php -f package.php '${versions}' > logs/package.log" escape="false" />
|
||||||
|
<exec dir="build" command="php -f build_diff.php '${prevversion}' '${newversion}' > logs/build_diff.log" escape="false" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
This target can be called using phingcall to retrieve a clean
|
||||||
|
checkout of a commit from git. It will only export the phpBB directory.
|
||||||
|
The properties revision and dir are required.
|
||||||
|
This target will remove directories that are not needed in distribution
|
||||||
|
and set correct permissions.
|
||||||
|
-->
|
||||||
|
<target name="export">
|
||||||
|
<exec dir="phpBB"
|
||||||
|
command="git archive ${revision} | tar -x -C ../${dir}"
|
||||||
|
checkreturn="true" />
|
||||||
|
<delete file="${dir}/config.php" />
|
||||||
|
<delete dir="${dir}/develop" />
|
||||||
|
<delete dir="${dir}/install/data" />
|
||||||
|
|
||||||
|
<echo msg="Setting permissions for checkout of ${revision} in ${dir}" />
|
||||||
|
<!-- set permissions of all files to 644, directories to 755 -->
|
||||||
|
<exec dir="${dir}" command="find -type f|xargs chmod 644" escape="false" />
|
||||||
|
<exec dir="${dir}" command="find -type d|xargs chmod 755" escape="false" />
|
||||||
|
<!-- set permissions of some directories to 777 -->
|
||||||
|
<chmod mode="0777" file="${dir}/cache" />
|
||||||
|
<chmod mode="0777" file="${dir}/store" />
|
||||||
|
<chmod mode="0777" file="${dir}/files" />
|
||||||
|
<chmod mode="0777" file="${dir}/images/avatars/upload" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="clean-diff-dir">
|
||||||
|
<delete dir="${dir}/cache" />
|
||||||
|
<delete dir="${dir}/docs" />
|
||||||
|
<delete dir="${dir}/files" />
|
||||||
|
<delete dir="${dir}/install" />
|
||||||
|
<delete dir="${dir}/store" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
|
@ -9,16 +9,26 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// CONFIG - Begin
|
if ($_SERVER['argc'] != 3)
|
||||||
$substitute_old = '3.0.6';
|
{
|
||||||
$substitute_new = '3.0.7-PL1';
|
die("Please specify the previous and current version as arguments (e.g. build_diff.php '1.0.2' '1.0.3').");
|
||||||
$simple_name_old = 'phpbb306';
|
}
|
||||||
$simple_name_new = 'phpbb307-PL1';
|
|
||||||
|
$old_version = trim($_SERVER['argv'][1]);
|
||||||
|
$new_version = trim($_SERVER['argv'][2]);
|
||||||
|
|
||||||
|
$substitute_old = $old_version;
|
||||||
|
$substitute_new = $new_version;
|
||||||
|
$simple_name_old = 'release-' . $old_version;
|
||||||
|
$simple_name_new = 'release-' . $new_version;
|
||||||
$echo_changes = false;
|
$echo_changes = false;
|
||||||
|
|
||||||
|
// DO NOT EVER USE THE FOLLOWING! Fix the script to generate proper changes,
|
||||||
|
// do NOT manually create them.
|
||||||
|
|
||||||
// Set this to true to just compress the changes and do not build them again
|
// Set this to true to just compress the changes and do not build them again
|
||||||
// This should be used for building custom modified txt file. ;)
|
// This should be used for building custom modified txt file. ;)
|
||||||
$package_changed_files = false;
|
$package_changed_files = false;
|
||||||
// CONFIG - End
|
|
||||||
|
|
||||||
//$debug_file = 'includes/functions_user.php'; //'styles/prosilver/style.cfg';
|
//$debug_file = 'includes/functions_user.php'; //'styles/prosilver/style.cfg';
|
||||||
$debug_file = false;
|
$debug_file = false;
|
||||||
|
@ -36,9 +46,6 @@ if (!$package_changed_files)
|
||||||
{
|
{
|
||||||
if (!$echo_changes)
|
if (!$echo_changes)
|
||||||
{
|
{
|
||||||
// Cleanup...
|
|
||||||
run_command("rm -R $location/save/*");
|
|
||||||
|
|
||||||
// Create directory...
|
// Create directory...
|
||||||
run_command("mkdir $location/save/{$s_name}");
|
run_command("mkdir $location/save/{$s_name}");
|
||||||
run_command("mkdir $location/save/{$s_name}/language");
|
run_command("mkdir $location/save/{$s_name}/language");
|
||||||
|
@ -72,14 +79,14 @@ if (!$echo_changes)
|
||||||
foreach ($compress_programs as $extension => $compress_command)
|
foreach ($compress_programs as $extension => $compress_command)
|
||||||
{
|
{
|
||||||
echo "Packaging code changes for $extension\n";
|
echo "Packaging code changes for $extension\n";
|
||||||
run_command("rm ./../../release_files/{$code_changes_filename}.{$extension}");
|
run_command("rm ./../../new_version/release_files/{$code_changes_filename}.{$extension}");
|
||||||
flush();
|
flush();
|
||||||
|
|
||||||
// Build Package
|
// Build Package
|
||||||
run_command("$compress_command ./../../release_files/{$code_changes_filename}.{$extension} *");
|
run_command("$compress_command ./../../new_version/release_files/{$code_changes_filename}.{$extension} *");
|
||||||
|
|
||||||
// Build MD5 Sum
|
// Build MD5 Sum
|
||||||
run_command("md5sum ./../../release_files/{$code_changes_filename}.{$extension} > ./../../release_files/{$code_changes_filename}.{$extension}.md5");
|
run_command("md5sum ./../../new_version/release_files/{$code_changes_filename}.{$extension} > ./../../new_version/release_files/{$code_changes_filename}.{$extension}.md5");
|
||||||
flush();
|
flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,6 @@ class build_package
|
||||||
var $old_packages;
|
var $old_packages;
|
||||||
var $versions;
|
var $versions;
|
||||||
var $locations;
|
var $locations;
|
||||||
var $clean_directory_structure;
|
|
||||||
var $files_to_copy;
|
|
||||||
var $files_to_remove;
|
|
||||||
var $remove_from_diff_structure;
|
|
||||||
|
|
||||||
// -c - context diff
|
// -c - context diff
|
||||||
// -r - compare recursive
|
// -r - compare recursive
|
||||||
|
@ -53,11 +49,11 @@ class build_package
|
||||||
$this->package_infos = array(
|
$this->package_infos = array(
|
||||||
'package_name' => 'phpBB3',
|
'package_name' => 'phpBB3',
|
||||||
'name_prefix' => 'phpbb',
|
'name_prefix' => 'phpbb',
|
||||||
'simple_name' => 'phpbb' . str_replace('.', '', $_latest),
|
'simple_name' => 'release-' . $_latest,
|
||||||
'new_version_number' => $_latest,
|
'new_version_number' => $_latest,
|
||||||
'short_version_number' => str_replace('.', '', $_latest),
|
'short_version_number' => str_replace('.', '', $_latest),
|
||||||
'release_filename' => 'phpBB-' . $_latest,
|
'release_filename' => 'phpBB-' . $_latest,
|
||||||
'last_version' => 'phpbb' . str_replace('.', '', $_before),
|
'last_version' => 'release-' . $_before,
|
||||||
'last_version_number' => $_before,
|
'last_version_number' => $_before,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -78,112 +74,7 @@ class build_package
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->old_packages['phpbb' . str_replace('.', '', $package_version)] = $package_version . '_to_';
|
$this->old_packages['release-' . $package_version] = $package_version . '_to_';
|
||||||
}
|
|
||||||
|
|
||||||
// We need to make sure this is up to date with the latest version
|
|
||||||
$this->clean_directory_structure = array(
|
|
||||||
'adm' => array(
|
|
||||||
'images' => '',
|
|
||||||
'style' => '',
|
|
||||||
),
|
|
||||||
'cache' => '',
|
|
||||||
'docs' => '',
|
|
||||||
'download' => '',
|
|
||||||
'files' => '',
|
|
||||||
'images' => array(
|
|
||||||
'avatars' => array(
|
|
||||||
'gallery' => '',
|
|
||||||
'upload' => '',
|
|
||||||
),
|
|
||||||
'icons' => array(
|
|
||||||
'misc' => '',
|
|
||||||
'smile' => '',
|
|
||||||
),
|
|
||||||
'ranks' => '',
|
|
||||||
'smilies' => '',
|
|
||||||
'upload_icons' => '',
|
|
||||||
),
|
|
||||||
'includes' => array(
|
|
||||||
'acm' => '',
|
|
||||||
'acp' => array(
|
|
||||||
'info' => '',
|
|
||||||
),
|
|
||||||
'auth' => '',
|
|
||||||
'captcha' => array(
|
|
||||||
'plugins' => '',
|
|
||||||
),
|
|
||||||
'diff' => '',
|
|
||||||
'db' => '',
|
|
||||||
'hooks' => '',
|
|
||||||
'mcp' => array(
|
|
||||||
'info' => '',
|
|
||||||
),
|
|
||||||
'questionnaire' => '',
|
|
||||||
'search' => '',
|
|
||||||
'ucp' => array(
|
|
||||||
'info' => '',
|
|
||||||
),
|
|
||||||
'utf' => array(
|
|
||||||
'data' => '',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'install' => array(
|
|
||||||
'convertors'=> '',
|
|
||||||
'schemas' => '',
|
|
||||||
// 'data' => '',
|
|
||||||
),
|
|
||||||
'language' => array(
|
|
||||||
'en' => array(
|
|
||||||
'acp' => '',
|
|
||||||
'email' => '',
|
|
||||||
'mods' => '',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'store' => '',
|
|
||||||
'styles' => array(
|
|
||||||
'subsilver2' => array(
|
|
||||||
'imageset' => array(
|
|
||||||
'en' => '',
|
|
||||||
),
|
|
||||||
'template' => '',
|
|
||||||
'theme' => array(
|
|
||||||
'images' => '',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'prosilver' => array(
|
|
||||||
'imageset' => array(
|
|
||||||
'en' => '',
|
|
||||||
),
|
|
||||||
'template' => '',
|
|
||||||
'theme' => array(
|
|
||||||
'images' => '',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Files to remove (not include within package)
|
|
||||||
$this->files_to_remove = array(); //array('includes/utf/data/recode_cjk.php');
|
|
||||||
|
|
||||||
// Files within the main directory to copy - do not include config.php
|
|
||||||
$this->files_to_copy = array(
|
|
||||||
'.htaccess', 'common.php', 'cron.php', 'faq.php', 'feed.php', 'index.php', 'mcp.php', 'memberlist.php', 'posting.php', 'report.php',
|
|
||||||
'search.php', 'style.php', 'ucp.php', 'viewforum.php', 'viewonline.php', 'viewtopic.php'
|
|
||||||
);
|
|
||||||
|
|
||||||
// These files/directories will be removed and not used for creating the patch files
|
|
||||||
$this->remove_from_diff_structure = array(
|
|
||||||
'config.php', 'cache', 'docs', 'files', 'install', 'store', 'develop'
|
|
||||||
);
|
|
||||||
|
|
||||||
// Writeable directories
|
|
||||||
$this->writeable = array('cache', 'store', 'images/avatars/upload', 'files');
|
|
||||||
|
|
||||||
// Fill the rest of the files_to_copy array
|
|
||||||
foreach ($this->clean_directory_structure as $cur_dir => $dir_struct)
|
|
||||||
{
|
|
||||||
$this->_fill_files_to_copy($this->locations['new_version'] . $cur_dir, $cur_dir, $dir_struct);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,66 +83,6 @@ class build_package
|
||||||
return $this->package_infos[$var];
|
return $this->package_infos[$var];
|
||||||
}
|
}
|
||||||
|
|
||||||
function _fill_files_to_copy($directory, $cur_dir, $dir_struct)
|
|
||||||
{
|
|
||||||
$dh = opendir($directory);
|
|
||||||
|
|
||||||
while ($file = readdir($dh))
|
|
||||||
{
|
|
||||||
if (is_file($directory . '/' . $file) && $file != '.' && $file != '..')
|
|
||||||
{
|
|
||||||
$_loc = str_replace($this->locations['new_version'], '', $directory . '/' . $file);
|
|
||||||
|
|
||||||
if (in_array($_loc, $this->files_to_remove))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->files_to_copy[] = $cur_dir . '/' . $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir($dh);
|
|
||||||
|
|
||||||
if (is_array($dir_struct))
|
|
||||||
{
|
|
||||||
foreach ($dir_struct as $_cur_dir => $_dir_struct)
|
|
||||||
{
|
|
||||||
$this->_fill_files_to_copy($directory . '/' . $_cur_dir, $cur_dir . '/' . $_cur_dir, $_dir_struct);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function adjust_permissions($directory)
|
|
||||||
{
|
|
||||||
$dh = opendir($directory);
|
|
||||||
|
|
||||||
while ($file = readdir($dh))
|
|
||||||
{
|
|
||||||
if ($file == '.' || $file == '..' || $file == '.svn')
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If file, then 644
|
|
||||||
if (is_file($directory . '/' . $file))
|
|
||||||
{
|
|
||||||
chmod($directory . '/' . $file, 0644);
|
|
||||||
}
|
|
||||||
else if (is_dir($directory . '/' . $file))
|
|
||||||
{
|
|
||||||
$_loc = str_replace($this->package_infos['dest_dir'] . '/', '', $directory . '/' . $file);
|
|
||||||
|
|
||||||
// If directory is within the writeable chmod to 777, else 755
|
|
||||||
$mode = (in_array($_loc, $this->writeable)) ? 0777 : 0755;
|
|
||||||
chmod($directory . '/' . $file, $mode);
|
|
||||||
|
|
||||||
// Now traverse to the directory
|
|
||||||
$this->adjust_permissions($directory . '/' . $file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir($dh);
|
|
||||||
}
|
|
||||||
|
|
||||||
function begin_status($headline)
|
function begin_status($headline)
|
||||||
{
|
{
|
||||||
if ($this->status_begun)
|
if ($this->status_begun)
|
||||||
|
|
|
@ -9,14 +9,17 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// The only thing i need to adjust. ;)
|
//$versions = array('3.0.2', '3.0.3', '3.0.4', '3.0.5', '3.0.6', '3.0.7-RC1', '3.0.7-RC2', '3.0.7', '3.0.7-PL1');
|
||||||
// Please always add the latest version number to the end
|
|
||||||
// Only have 5 releases here...
|
if ($_SERVER['argc'] < 2)
|
||||||
// If RC8 drops remove the install/data directory
|
{
|
||||||
//$versions = array('3.0.2', '3.0.3-RC1', '3.0.3', '3.0.4-RC1', '3.0.4', '3.0.5-RC1', '3.0.5', '3.0.6-RC1', '3.0.6-RC2', '3.0.6-RC3');
|
die("Please specify a list of versions as the first argument (e.g. package.php '1.0.0, 1.0.1, 1.0.2').");
|
||||||
//$versions = array('3.0.2', '3.0.3', '3.0.4', '3.0.5', '3.0.6', '3.0.7-RC1', '3.0.7');
|
}
|
||||||
$versions = array('3.0.2', '3.0.3', '3.0.4', '3.0.5', '3.0.6', '3.0.7-RC1', '3.0.7-RC2', '3.0.7', '3.0.7-PL1');
|
|
||||||
$verbose = false;
|
$versions = explode(',', $_SERVER['argv'][1]);
|
||||||
|
$versions = array_map('trim', $versions);
|
||||||
|
|
||||||
|
$verbose = true;
|
||||||
|
|
||||||
require('build_helper.php');
|
require('build_helper.php');
|
||||||
|
|
||||||
|
@ -25,130 +28,6 @@ $package = new build_package($versions, $verbose);
|
||||||
echo "Building Release Packages\n";
|
echo "Building Release Packages\n";
|
||||||
echo "Now all three package types (patch, files, release) are built as well as the update package (update).\n";
|
echo "Now all three package types (patch, files, release) are built as well as the update package (update).\n";
|
||||||
|
|
||||||
$package->begin_status('Remove temporary files');
|
|
||||||
|
|
||||||
// Cleanup...
|
|
||||||
$package->run_command('rm -Rv ' . $package->get('dest_dir'));
|
|
||||||
$package->run_command('rm -Rv ' . $package->get('diff_dir'));
|
|
||||||
$package->run_command('rm -Rv ' . $package->get('patch_directory'));
|
|
||||||
$package->run_command('rm -Rv ' . $package->get('files_directory'));
|
|
||||||
$package->run_command('rm -Rv ' . $package->get('update_directory'));
|
|
||||||
$package->run_command('rm -Rv ' . $package->get('release_directory'));
|
|
||||||
|
|
||||||
$package->begin_status('Create new directories');
|
|
||||||
|
|
||||||
// Make sure the directories got removed
|
|
||||||
while (file_exists($package->get('update_directory')))
|
|
||||||
{
|
|
||||||
sleep(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!file_exists($package->get('dest_dir')))
|
|
||||||
{
|
|
||||||
$package->run_command('mkdir ' . $package->get('dest_dir'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!file_exists($package->get('diff_dir')))
|
|
||||||
{
|
|
||||||
$package->run_command('mkdir ' . $package->get('diff_dir'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!file_exists($package->get('patch_directory')))
|
|
||||||
{
|
|
||||||
$package->run_command('mkdir ' . $package->get('patch_directory'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!file_exists($package->get('files_directory')))
|
|
||||||
{
|
|
||||||
$package->run_command('mkdir ' . $package->get('files_directory'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!file_exists($package->get('update_directory')))
|
|
||||||
{
|
|
||||||
$package->run_command('mkdir ' . $package->get('update_directory'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!file_exists($package->get('release_directory')))
|
|
||||||
{
|
|
||||||
$package->run_command('mkdir ' . $package->get('release_directory'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$package->begin_status('Copy release files to clean release directory');
|
|
||||||
|
|
||||||
// Create config.php file
|
|
||||||
$package->run_command('touch ' . $package->get('dest_dir') . '/config.php');
|
|
||||||
//$package->run_command('sudo chown www-data:www-data ' . $package->get('dest_dir') . '/config.php');
|
|
||||||
|
|
||||||
// Create new directory structure
|
|
||||||
foreach ($package->clean_directory_structure as $dir => $dir_struct)
|
|
||||||
{
|
|
||||||
$package->create_directory($package->get('dest_dir') . '/' . $dir, $dir_struct);
|
|
||||||
}
|
|
||||||
|
|
||||||
// First step is to copy the new version over (clean structure)
|
|
||||||
foreach ($package->files_to_copy as $file)
|
|
||||||
{
|
|
||||||
$source_file = $package->locations['new_version'] . $file;
|
|
||||||
$dest_file = $package->get('dest_dir') . '/' . $file;
|
|
||||||
|
|
||||||
$package->run_command("cp -p $source_file $dest_file");
|
|
||||||
}
|
|
||||||
|
|
||||||
// fix line endings
|
|
||||||
chdir($package->get('dest_dir'));
|
|
||||||
$package->run_command($package->locations['new_version'] . 'develop/fix_files.sh');
|
|
||||||
|
|
||||||
// Now clean up the permissions
|
|
||||||
$package->begin_status('Adjust permissions');
|
|
||||||
|
|
||||||
$package->adjust_permissions($package->get('dest_dir'));
|
|
||||||
|
|
||||||
// Now create a version for diffing the version - copy the tree over to old_versions...
|
|
||||||
$package->begin_status('Create diff directory for obtaining file differences');
|
|
||||||
|
|
||||||
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/* ' . $package->get('diff_dir'));
|
|
||||||
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/.htaccess ' . $package->get('diff_dir'));
|
|
||||||
|
|
||||||
// Cleanup diff directory (only contents to diff)
|
|
||||||
foreach ($package->remove_from_diff_structure as $remove_dir)
|
|
||||||
{
|
|
||||||
$package->run_command('rm -Rv ' . $package->get('diff_dir') . '/' . $remove_dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now, first of all we need to rebuild all old packages we want to support
|
|
||||||
foreach ($package->old_packages as $package_name => $tag_name)
|
|
||||||
{
|
|
||||||
$package->begin_status('Create old packages directory for diffing to ' . $package_name);
|
|
||||||
|
|
||||||
chdir($package->locations['old_versions']);
|
|
||||||
|
|
||||||
if (is_dir($package->locations['old_versions'] . $package_name))
|
|
||||||
{
|
|
||||||
$package->run_command('rm -Rv ' . $package->locations['old_versions'] . $package_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now, create a new one...
|
|
||||||
$tag_name = 'release_' . str_replace(array('.', '_to_'), array('_', ''), $tag_name);
|
|
||||||
|
|
||||||
$package->run_command('svn export --non-interactive http://code.phpbb.com/svn/phpbb/tags/' . $tag_name . '/phpBB/ ' . $package_name);
|
|
||||||
|
|
||||||
$location = $package->locations['old_versions'] . $package_name;
|
|
||||||
chdir($location . '/');
|
|
||||||
|
|
||||||
$package->run_command($package->locations['new_version'] . 'develop/fix_files.sh');
|
|
||||||
|
|
||||||
// Now clean up the permissions
|
|
||||||
$package->begin_status('Adjust permissions for package ' . $package_name);
|
|
||||||
|
|
||||||
$package->adjust_permissions($location);
|
|
||||||
|
|
||||||
// Cleanup diff directory (only contents to diff)
|
|
||||||
foreach ($package->remove_from_diff_structure as $remove_dir)
|
|
||||||
{
|
|
||||||
$package->run_command('rm -Rv ' . $location . '/' . $remove_dir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Go trough all versions making a diff if we even have old versions
|
// Go trough all versions making a diff if we even have old versions
|
||||||
// For phpBB 3.0.x we might choose a different update method, rendering the things below useless...
|
// For phpBB 3.0.x we might choose a different update method, rendering the things below useless...
|
||||||
if (sizeof($package->old_packages))
|
if (sizeof($package->old_packages))
|
||||||
|
@ -160,10 +39,7 @@ if (sizeof($package->old_packages))
|
||||||
|
|
||||||
foreach ($package->old_packages as $_package_name => $dest_package_filename)
|
foreach ($package->old_packages as $_package_name => $dest_package_filename)
|
||||||
{
|
{
|
||||||
$package->begin_status('Creating patch/diff files for phpBB-' . $dest_package_filename . $package->get('new_version_number'));
|
$package->begin_status('Parsing patch/diff files for phpBB-' . $dest_package_filename . $package->get('new_version_number'));
|
||||||
|
|
||||||
$dest_package_filename = $package->get('patch_directory') . '/phpBB-' . $dest_package_filename . $package->get('new_version_number') . '.patch';
|
|
||||||
$package->run_command('diff ' . $package->diff_options . ' ' . $_package_name . ' ' . $package->get('simple_name') . ' > ' . $dest_package_filename);
|
|
||||||
|
|
||||||
// Parse this diff to determine file changes from the checked versions and save them
|
// Parse this diff to determine file changes from the checked versions and save them
|
||||||
$diff_file_changes[$_package_name] = $package->collect_diff_files($dest_package_filename, $_package_name);
|
$diff_file_changes[$_package_name] = $package->collect_diff_files($dest_package_filename, $_package_name);
|
||||||
|
@ -404,7 +280,6 @@ if (sizeof($package->old_packages))
|
||||||
foreach ($compress_programs as $extension => $compress_command)
|
foreach ($compress_programs as $extension => $compress_command)
|
||||||
{
|
{
|
||||||
$package->begin_status('Packaging phpBB Patch Files for ' . $extension);
|
$package->begin_status('Packaging phpBB Patch Files for ' . $extension);
|
||||||
$package->run_command('rm -v ../release_files/' . $package->get('release_filename') . '-patch.' . $extension);
|
|
||||||
|
|
||||||
// Build Package
|
// Build Package
|
||||||
$package->run_command($compress_command . ' ../release_files/' . $package->get('release_filename') . '-patch.' . $extension . ' *');
|
$package->run_command($compress_command . ' ../release_files/' . $package->get('release_filename') . '-patch.' . $extension . ' *');
|
||||||
|
@ -420,7 +295,6 @@ if (sizeof($package->old_packages))
|
||||||
{
|
{
|
||||||
$package->begin_status('Packaging phpBB Files for ' . $extension);
|
$package->begin_status('Packaging phpBB Files for ' . $extension);
|
||||||
|
|
||||||
$package->run_command('rm -v ../release_files/' . $package->get('release_filename') . '-files.' . $extension);
|
|
||||||
$package->run_command('mkdir ' . $package->get('files_directory') . '/release');
|
$package->run_command('mkdir ' . $package->get('files_directory') . '/release');
|
||||||
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $package->get('files_directory') . '/release');
|
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $package->get('files_directory') . '/release');
|
||||||
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $package->get('files_directory') . '/release');
|
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $package->get('files_directory') . '/release');
|
||||||
|
@ -457,7 +331,6 @@ if (sizeof($package->old_packages))
|
||||||
|
|
||||||
$package->begin_status('Packaging phpBB Update for ' . $extension);
|
$package->begin_status('Packaging phpBB Update for ' . $extension);
|
||||||
|
|
||||||
$package->run_command('rm -v ../release_files/' . $package->get('release_filename') . '-update.' . $extension);
|
|
||||||
$package->run_command('mkdir ' . $package->get('update_directory') . '/release');
|
$package->run_command('mkdir ' . $package->get('update_directory') . '/release');
|
||||||
|
|
||||||
// Pack update files
|
// Pack update files
|
||||||
|
@ -521,7 +394,6 @@ foreach ($compress_programs as $extension => $compress_command)
|
||||||
// Microsoft Web PI packaging
|
// Microsoft Web PI packaging
|
||||||
$package->begin_status('Packaging phpBB for Microsoft WebPI');
|
$package->begin_status('Packaging phpBB for Microsoft WebPI');
|
||||||
$file = './release_files/' . $package->get('release_filename') . '.webpi.zip';
|
$file = './release_files/' . $package->get('release_filename') . '.webpi.zip';
|
||||||
$package->run_command("rm -v $file");
|
|
||||||
$package->run_command('cp -p ./release_files/' . $package->get('release_filename') . ".zip $file");
|
$package->run_command('cp -p ./release_files/' . $package->get('release_filename') . ".zip $file");
|
||||||
$package->run_command('cd ./../webpi && ' . $compress_programs['zip'] . " ./../new_version/$file *");
|
$package->run_command('cd ./../webpi && ' . $compress_programs['zip'] . " ./../new_version/$file *");
|
||||||
$package->run_command("md5sum $file > $file.md5");
|
$package->run_command("md5sum $file > $file.md5");
|
||||||
|
|
Loading…
Add table
Reference in a new issue