* Modify the makefile for multiple concurrency.
This commit is contained in:
29
Makefile
29
Makefile
@@ -1,4 +1,5 @@
|
||||
VERSION = $(shell head -n 1 VERSION)
|
||||
LITEVERSION = $(shell head -n 1 extension/lite/LITEVERSION)
|
||||
XUANVERSION = $(shell head -n 1 xuanxuan/XUANVERSION)
|
||||
XVERSION = $(shell head -n 1 xuanxuan/XVERSION)
|
||||
|
||||
@@ -20,6 +21,8 @@ clean:
|
||||
rm -rf buildroot/
|
||||
rm -fr lampp
|
||||
rm -fr zentaoxx
|
||||
rm -fr tmp/
|
||||
rm -f *.sh
|
||||
common:
|
||||
mkdir zentaopms
|
||||
cp -fr api zentaopms/
|
||||
@@ -133,6 +136,8 @@ zentaoxx:
|
||||
sed -i 's/xxb_/zt_/g' zentaoxx/db/*.sql
|
||||
sed -i "s#\$this->app->getModuleRoot() . 'im/apischeme.json'#\$this->app->getExtensionRoot() . 'xuan/im/apischeme.json'#g" zentaoxx/extension/xuan/im/model.php
|
||||
sed -i "/getModuleExtPath(/ r tools/fixxuan" zentaoxx/framework/xuanxuan.class.php
|
||||
sed -i "s/'..\/..\/common\/view\/header.html.php'/\$$app->getModuleRoot() . 'common\/view\/header.html.php'/g" zentaoxx/extension/xuan/conference/view/admin.html.php
|
||||
sed -i "s/'..\/..\/common\/view\/footer.html.php'/\$$app->getModuleRoot() . 'common\/view\/footer.html.php'/g" zentaoxx/extension/xuan/conference/view/admin.html.php
|
||||
echo "ALTER TABLE \`zt_user\` ADD \`pinyin\` varchar(255) NOT NULL DEFAULT '' AFTER \`realname\`;" >> zentaoxx/db/xuanxuan.sql
|
||||
mkdir zentaoxx/tools; cp tools/cn2tw.php zentaoxx/tools; cd zentaoxx/tools; php cn2tw.php
|
||||
cp tools/en2de.php zentaoxx/tools; cd zentaoxx/tools; php en2de.php ../
|
||||
@@ -232,7 +237,7 @@ enrpm:
|
||||
rpmbuild -ba ~/rpmbuild/SPECS/zentaopms.spec
|
||||
cp ~/rpmbuild/RPMS/noarch/zentaoalm-${VERSION}-1.noarch.rpm ./
|
||||
rm -rf ~/rpmbuild
|
||||
ci:
|
||||
ciCommon:
|
||||
git pull
|
||||
make common
|
||||
|
||||
@@ -247,7 +252,23 @@ ci:
|
||||
rm -fr zentaopms zentaoxx zentaoxx.*.zip
|
||||
make en
|
||||
rm -fr zentaopms zentaoxx zentaoxx.*.zip
|
||||
php tools/mergezentaopms.php $(VERSION)
|
||||
rm -f zentaobiz*.zip zentaomax*.zip $(BUILD_PATH)/ZenTaoPMS.$(VERSION).zip $(RELEASE_PATH)/ZenTaoALM.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION)*.zip $(RELEASE_PATH)/*.deb $(RELEASE_PATH)/*.rpm
|
||||
cp ZenTaoPMS.$(VERSION).zip $(BUILD_PATH)
|
||||
ci:
|
||||
make ciCommon
|
||||
php tools/packZip.php $(VERSION)
|
||||
sh zip.sh
|
||||
rm -rf tmp/
|
||||
php tools/packDeb.php $(VERSION)
|
||||
sh deb.sh
|
||||
rm -rf tmp/
|
||||
php tools/packRpm.php $(VERSION)
|
||||
sh rpm.sh
|
||||
rm -rf tmp/
|
||||
rm -f zentaobiz*.zip zentaomax*.zip $(BUILD_PATH)/ZenTaoPMS.$(VERSION).zip $(RELEASE_PATH)/ZenTaoALM.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION)*.zip $(RELEASE_PATH)/*.deb $(RELEASE_PATH)/*.rpm *.sh
|
||||
cp ZenTaoPMS.$(VERSION).zip $(BUILD_PATH)
|
||||
mv *.zip *.deb *.rpm $(RELEASE_PATH)
|
||||
lite:
|
||||
make ciCommon
|
||||
php tools/packZip.php $(VERSION) $(LITEVERSION)
|
||||
rm -f zentaobiz*.zip zentaomax*.zip $(BUILD_PATH)/ZenTaoPMS.$(VERSION).zip $(RELEASE_PATH)/ZenTaoALM.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoALM.$(LITEVERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(LITEVERSION)*.zip *.sh
|
||||
cp ZenTaoPMS.$(VERSION).zip $(BUILD_PATH)
|
||||
mv *.zip $(RELEASE_PATH)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
%define __os_install_post %{nil}
|
||||
|
||||
Name:zentaopms
|
||||
Version:7.1.stable
|
||||
Release:1
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
<?php
|
||||
$pmsVersion = $argv[1];
|
||||
$basePath = dirname(dirname(__FILE__));
|
||||
|
||||
if(empty($pmsVersion)) die("Please give me pms version.\n");
|
||||
|
||||
$releasePath = exec('echo $ZENTAO_RELEASE_PATH;');
|
||||
$releasePath = !empty($releasePath) ? $releasePath : $basePath;
|
||||
|
||||
if(!file_exists($releasePath . '/zentaopms.zip')) die("Please give me encrypted packages.\n");
|
||||
|
||||
`cp $releasePath/zentaopms.zip $basePath`;
|
||||
`unzip zentaopms.zip; rm zentaopms.zip`;
|
||||
|
||||
$fileList = array();
|
||||
$fileList[] = "{$basePath}/zentaobiz.php5.3_5.6.zip";
|
||||
$fileList[] = "{$basePath}/zentaobiz.php7.0.zip";
|
||||
$fileList[] = "{$basePath}/zentaobiz.php7.1.zip";
|
||||
$fileList[] = "{$basePath}/zentaobiz.php7.2_7.4.zip";
|
||||
|
||||
$fileList[] = "{$basePath}/zentaomax.php5.3_5.6.zip";
|
||||
$fileList[] = "{$basePath}/zentaomax.php7.0.zip";
|
||||
$fileList[] = "{$basePath}/zentaomax.php7.1.zip";
|
||||
$fileList[] = "{$basePath}/zentaomax.php7.2_7.4.zip";
|
||||
|
||||
checkExistsFiles($fileList);
|
||||
|
||||
// zip
|
||||
foreach(array('zh-cn', 'en') as $langType)
|
||||
{
|
||||
$packPrefix = $langType == 'zh-cn' ? 'ZenTaoPMS' : 'ZenTaoALM';
|
||||
$version = $langType == 'zh-cn' ? $pmsVersion : $pmsVersion . '.int';
|
||||
$dirName = $langType == 'zh-cn' ? 'zentaopms' : 'zentaoalm';
|
||||
|
||||
foreach(array('5.3_5.6', '7.0', '7.1', '7.2_7.4') as $phpVersion)
|
||||
{
|
||||
echo "zip $packPrefix.{$version}.php{$phpVersion}.zip\n";
|
||||
`unzip $packPrefix.{$version}.zip`;
|
||||
`unzip zentaobiz.php{$phpVersion}.zip`;
|
||||
`unzip zentaomax.php{$phpVersion}.zip`;
|
||||
`cp -rf biz/* $dirName/`;
|
||||
`cp -rf max/* $dirName/`;
|
||||
`zip -r $packPrefix.{$version}.php{$phpVersion}.zip $dirName`;
|
||||
`rm -rf biz/ max/ $dirName/`;
|
||||
}
|
||||
}
|
||||
// deb
|
||||
//foreach(array('zh-cn', 'en') as $langType)
|
||||
//{
|
||||
// $packPrefix = $langType == 'zh-cn' ? 'ZenTaoPMS' : 'ZenTaoALM';
|
||||
// $version = $langType == 'zh-cn' ? $pmsVersion : $pmsVersion . '.int';
|
||||
// $dirName = $langType == 'zh-cn' ? 'zentaopms' : 'zentaoalm';
|
||||
//
|
||||
// foreach(array('5.3_5.6', '7.0', '7.1', '7.2_7.4') as $phpVersion)
|
||||
// {
|
||||
// echo "dpkg {$packPrefix}_{$version}_{$phpVersion}_1_all.deb\n";
|
||||
// `mkdir buildroot`;
|
||||
// `cp -r build/debian/DEBIAN buildroot`;
|
||||
// `sed -i '/^Version/cVersion: $version' buildroot/DEBIAN/control`;
|
||||
// `mkdir buildroot/opt`;
|
||||
// `mkdir buildroot/etc/apache2/sites-enabled/ -p`;
|
||||
// `cp build/debian/zentaopms.conf buildroot/etc/apache2/sites-enabled/`;
|
||||
// `cp $packPrefix.$version.php{$phpVersion}.zip buildroot/opt`;
|
||||
// `cd buildroot/opt; unzip $packPrefix.$version.php{$phpVersion}.zip; mv $dirName zentao; rm $packPrefix.$version.php{$phpVersion}.zip`;
|
||||
// `sed -i 's/index.php/\/zentao\/index.php/' buildroot/opt/zentao/www/.htaccess`;
|
||||
// `sudo dpkg -b buildroot/ {$packPrefix}_{$version}_{$phpVersion}_1_all.deb`;
|
||||
// `rm -rf buildroot`;
|
||||
// }
|
||||
//}
|
||||
//// rpm
|
||||
//foreach(array('zh-cn', 'en') as $langType)
|
||||
//{
|
||||
// $packPrefix = $langType == 'zh-cn' ? 'ZenTaoPMS' : 'ZenTaoALM';
|
||||
// $version = $langType == 'zh-cn' ? $pmsVersion : $pmsVersion . '.int';
|
||||
// $dirName = $langType == 'zh-cn' ? 'zentaopms' : 'zentaoalm';
|
||||
//
|
||||
// foreach(array('5.3_5.6', '7.0', '7.1', '7.2_7.4') as $phpVersion)
|
||||
// {
|
||||
// echo "rpmbuild {$dirName}-{$version}-php{$phpVersion}-1.noarch.rpm\n";
|
||||
// `mkdir ~/rpmbuild/SPECS -p`;
|
||||
// `mkdir ~/rpmbuild/SOURCES`;
|
||||
// `mkdir ~/rpmbuild/SOURCES/etc/httpd/conf.d/ -p`;
|
||||
// `mkdir ~/rpmbuild/SOURCES/opt/ -p`;
|
||||
//
|
||||
// `cp build/rpm/zentaopms.spec ~/rpmbuild/SPECS`;
|
||||
// `sed -i '/^Version/cVersion:$version' ~/rpmbuild/SPECS/zentaopms.spec`;
|
||||
// if($langType == 'en') `sed -i '/^Name:/cName:zentaoalm' ~/rpmbuild/SPECS/zentaopms.spec`;
|
||||
//
|
||||
// `cp $packPrefix.$version.php{$phpVersion}.zip ~/rpmbuild/SOURCES`;
|
||||
// if($langType == 'zh-cn') `cp build/debian/zentaopms.conf ~/rpmbuild/SOURCES/etc/httpd/conf.d/`;
|
||||
// if($langType == 'en') `cp build/debian/zentaopms.conf ~/rpmbuild/SOURCES/etc/httpd/conf.d/zentaoalm.conf`;
|
||||
//
|
||||
// `cd ~/rpmbuild/SOURCES; unzip $packPrefix.$version.php{$phpVersion}.zip; mv $dirName opt/zentao;`;
|
||||
// `sed -i 's/index.php/\/zentao\/index.php/' ~/rpmbuild/SOURCES/opt/zentao/www/.htaccess`;
|
||||
// `cd ~/rpmbuild/SOURCES; tar -czvf $dirName-$version.tar.gz etc opt; rm -rf $packPrefix.$version.php{$phpVersion}.zip etc opt;`;
|
||||
//
|
||||
// `rpmbuild -ba ~/rpmbuild/SPECS/zentaopms.spec`;
|
||||
// `cp ~/rpmbuild/RPMS/noarch/$dirName-$version-1.noarch.rpm ./{$dirName}-{$version}-php{$phpVersion}-1.noarch.rpm`;
|
||||
// `rm -rf ~/rpmbuild`;
|
||||
// }
|
||||
//}
|
||||
|
||||
function checkExistsFiles($fileList)
|
||||
{
|
||||
$files = '';
|
||||
foreach($fileList as $file)
|
||||
{
|
||||
if(!file_exists($file)) echo basename($file) . " is not exists\n";
|
||||
}
|
||||
}
|
||||
76
tools/packDeb.php
Normal file
76
tools/packDeb.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/* Get pms version and lite version. */
|
||||
$pmsVersion = $argv[1];
|
||||
if(empty($pmsVersion)) die("Please give me pms version.\n");
|
||||
|
||||
/* Zip file pathes. */
|
||||
$basePath = dirname(dirname(__FILE__));
|
||||
$fileList = array();
|
||||
$fileList[] = "{$basePath}/ZenTaoPMS.$pmsVersion.php5.3_5.6.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoPMS.$pmsVersion.php7.0.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoPMS.$pmsVersion.php7.1.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoPMS.$pmsVersion.php7.2_7.4.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoPMS.$pmsVersion.php8.0.zip";
|
||||
|
||||
$fileList[] = "{$basePath}/ZenTaoALM.$pmsVersion.int.php5.3_5.6.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoALM.$pmsVersion.int.php7.0.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoALM.$pmsVersion.int.php7.1.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoALM.$pmsVersion.int.php7.2_7.4.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoALM.$pmsVersion.int.php8.0.zip";
|
||||
|
||||
foreach($fileList as $file) if(!file_exists($file)) echo basename($file) . " is not exists\n";
|
||||
|
||||
/* Create shells to make deb format packages. */
|
||||
$shellList = array();
|
||||
foreach(array('zh-cn', 'en') as $langType)
|
||||
{
|
||||
/* Init vars. */
|
||||
$packPrefix = $langType == 'zh-cn' ? 'ZenTaoPMS' : 'ZenTaoALM';
|
||||
$version = $langType == 'zh-cn' ? $pmsVersion : $pmsVersion . '.int';
|
||||
$dirName = $langType == 'zh-cn' ? 'zentaopms' : 'zentaoalm';
|
||||
|
||||
/* Cycle the php versions. */
|
||||
foreach(array('5.3_5.6', '7.0', '7.1', '7.2_7.4', '8.0') as $phpVersion)
|
||||
{
|
||||
/* File name. */
|
||||
$workDir = "tmp/$packPrefix.{$version}.{$phpVersion}/";
|
||||
$shellName = $workDir . 'make.sh';
|
||||
echo "Creating $shellName\n";
|
||||
|
||||
mkdir($workDir, 0777, true);
|
||||
|
||||
/* The commands of the shell. */
|
||||
$command = "cd $workDir\n";
|
||||
$command .= "mkdir buildroot\n";
|
||||
$command .= "mkdir buildroot/opt\n";
|
||||
$command .= "mkdir buildroot/etc/apache2/sites-enabled/ -p\n";
|
||||
|
||||
$command .= "cp -r ../../build/debian/DEBIAN buildroot\n";
|
||||
$command .= "sed -i '/^Version/cVersion: $version' buildroot/DEBIAN/control\n";
|
||||
|
||||
$command .= "cp ../../build/debian/zentaopms.conf buildroot/etc/apache2/sites-enabled/\n";
|
||||
$command .= "cp ../../$packPrefix.$version.php{$phpVersion}.zip buildroot/opt\n";
|
||||
$command .= "cd buildroot/opt; unzip $packPrefix.$version.php{$phpVersion}.zip; mv $dirName zentao; rm $packPrefix.$version.php{$phpVersion}.zip\n";
|
||||
|
||||
$command .= "sed -i 's/index.php/\/zentao\/index.php/' zentao/www/.htaccess\n";
|
||||
$command .= "cd ../../\n";
|
||||
$command .= "sudo dpkg -b buildroot/ {$packPrefix}_{$version}_php{$phpVersion}_1_all.deb\n";
|
||||
$command .= "mv *.deb ../../\n";
|
||||
|
||||
$command .= "rm -rf buildroot\n";
|
||||
|
||||
file_put_contents($shellName, $command);
|
||||
|
||||
$shellList[] = $shellName;
|
||||
}
|
||||
}
|
||||
|
||||
/* Execute the shells. */
|
||||
$lines = '';
|
||||
foreach($shellList as $shellName)
|
||||
{
|
||||
echo $shellName . "\n";
|
||||
$lines .= "sh $shellName &\n";
|
||||
}
|
||||
$lines .= "wait\necho 'Deb packages has done.'";
|
||||
file_put_contents('deb.sh', $lines);
|
||||
83
tools/packRpm.php
Normal file
83
tools/packRpm.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/* Get pms version and lite version. */
|
||||
$pmsVersion = $argv[1];
|
||||
if(empty($pmsVersion)) die("Please give me pms version.\n");
|
||||
|
||||
/* Zip file pathes. */
|
||||
$basePath = dirname(dirname(__FILE__));
|
||||
$fileList = array();
|
||||
$fileList[] = "{$basePath}/ZenTaoPMS.$pmsVersion.php5.3_5.6.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoPMS.$pmsVersion.php7.0.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoPMS.$pmsVersion.php7.1.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoPMS.$pmsVersion.php7.2_7.4.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoPMS.$pmsVersion.php8.0.zip";
|
||||
|
||||
$fileList[] = "{$basePath}/ZenTaoALM.$pmsVersion.int.php5.3_5.6.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoALM.$pmsVersion.int.php7.0.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoALM.$pmsVersion.int.php7.1.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoALM.$pmsVersion.int.php7.2_7.4.zip";
|
||||
$fileList[] = "{$basePath}/ZenTaoALM.$pmsVersion.int.php8.0.zip";
|
||||
|
||||
foreach($fileList as $file) if(!file_exists($file)) echo basename($file) . " is not exists\n";
|
||||
|
||||
/* Create shells to make rpm format packages. */
|
||||
$shellList = array();
|
||||
foreach(array('zh-cn', 'en') as $langType)
|
||||
{
|
||||
/* Init vars. */
|
||||
$packPrefix = $langType == 'zh-cn' ? 'ZenTaoPMS' : 'ZenTaoALM';
|
||||
$version = $langType == 'zh-cn' ? $pmsVersion : $pmsVersion . '.int';
|
||||
$dirName = $langType == 'zh-cn' ? 'zentaopms' : 'zentaoalm';
|
||||
|
||||
/* Cycle the php versions. */
|
||||
foreach(array('5.3_5.6', '7.0', '7.1', '7.2_7.4', '8.0') as $phpVersion)
|
||||
{
|
||||
/* File name. */
|
||||
$workDir = "tmp/$packPrefix.{$version}.{$phpVersion}/";
|
||||
$shellName = $workDir . 'make.sh';
|
||||
echo "Creating $shellName\n";
|
||||
|
||||
mkdir($workDir, 0777, true);
|
||||
|
||||
/* The commands of the shell. */
|
||||
$command = "cd $workDir\n";
|
||||
$command .= "mkdir rpmbuild/SPECS -p\n";
|
||||
$command .= "mkdir rpmbuild/SOURCES\n";
|
||||
$command .= "mkdir rpmbuild/SOURCES/etc/httpd/conf.d/ -p\n";
|
||||
$command .= "mkdir rpmbuild/SOURCES/opt/ -p\n";
|
||||
|
||||
$command .= "cp ../../build/rpm/zentaopms.spec rpmbuild/SPECS\n";
|
||||
$command .= "sed -i '/^Version/cVersion:$version' rpmbuild/SPECS/zentaopms.spec\n";
|
||||
if($langType == 'en') $command .= "sed -i '/^Name:/cName:zentaoalm' rpmbuild/SPECS/zentaopms.spec\n";
|
||||
|
||||
$command .= "cp ../../$packPrefix.$version.php{$phpVersion}.zip rpmbuild/SOURCES\n";
|
||||
if($langType == 'zh-cn') $command .= "cp ../../build/debian/zentaopms.conf rpmbuild/SOURCES/etc/httpd/conf.d/\n";
|
||||
if($langType == 'en') $command .= "cp ../../build/debian/zentaopms.conf rpmbuild/SOURCES/etc/httpd/conf.d/zentaoalm.conf\n";
|
||||
|
||||
$command .= "cd rpmbuild/SOURCES; unzip $packPrefix.$version.php{$phpVersion}.zip; mv $dirName opt/zentao;\n";
|
||||
$command .= "sed -i 's/index.php/\/zentao\/index.php/' opt/zentao/www/.htaccess\n";
|
||||
$command .= "tar -czvf $dirName-$version.tar.gz etc opt; rm -rf $packPrefix.$version.php{$phpVersion}.zip etc opt;\n";
|
||||
|
||||
$command .= "cd ../../\n";
|
||||
$command .= "rpmbuild --define \"_topdir \${PWD}/rpmbuild\" -ba rpmbuild/SPECS/zentaopms.spec\n";
|
||||
$command .= "cp rpmbuild/RPMS/noarch/$dirName-$version-1.noarch.rpm ./{$dirName}-{$version}-php{$phpVersion}-1.noarch.rpm\n";
|
||||
|
||||
$command .= "mv {$dirName}-{$version}-php{$phpVersion}-1.noarch.rpm ../../\n";
|
||||
|
||||
$command .= "rm -rf rpmbuild\n";
|
||||
|
||||
file_put_contents($shellName, $command);
|
||||
|
||||
$shellList[] = $shellName;
|
||||
}
|
||||
}
|
||||
|
||||
/* Execute the shells. */
|
||||
$lines = '';
|
||||
foreach($shellList as $shellName)
|
||||
{
|
||||
echo $shellName . "\n";
|
||||
$lines .= "sh $shellName &\n";
|
||||
}
|
||||
$lines .= "wait\necho 'Rpm packages has done.'";
|
||||
file_put_contents('rpm.sh', $lines);
|
||||
82
tools/packZip.php
Normal file
82
tools/packZip.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/* Get pms version and lite version. */
|
||||
$pmsVersion = $argv[1];
|
||||
if(empty($pmsVersion)) die("Please give me pms version.\n");
|
||||
$liteVersion = isset($argv[2]) ? $argv[2] : '';
|
||||
|
||||
/* File pathes. */
|
||||
$basePath = dirname(dirname(__FILE__));
|
||||
$releasePath = getenv('ZENTAO_RELEASE_PATH');
|
||||
$releasePath = !empty($releasePath) ? $releasePath : $basePath;
|
||||
if(!file_exists($releasePath . '/zentaopms.zip')) die("Please give me encrypted packages.\n");
|
||||
|
||||
/* Get the encrypted packages. */
|
||||
`cp $releasePath/zentaopms.zip $basePath`;
|
||||
`unzip zentaopms.zip; rm zentaopms.zip`;
|
||||
|
||||
/* Encrypted packages list. */
|
||||
$fileList = array();
|
||||
$fileList[] = "{$basePath}/zentaobiz.php5.3_5.6.zip";
|
||||
$fileList[] = "{$basePath}/zentaobiz.php7.0.zip";
|
||||
$fileList[] = "{$basePath}/zentaobiz.php7.1.zip";
|
||||
$fileList[] = "{$basePath}/zentaobiz.php7.2_7.4.zip";
|
||||
|
||||
$fileList[] = "{$basePath}/zentaomax.php5.3_5.6.zip";
|
||||
$fileList[] = "{$basePath}/zentaomax.php7.0.zip";
|
||||
$fileList[] = "{$basePath}/zentaomax.php7.1.zip";
|
||||
$fileList[] = "{$basePath}/zentaomax.php7.2_7.4.zip";
|
||||
|
||||
foreach($fileList as $file) if(!file_exists($file)) echo basename($file) . " is not exists\n";
|
||||
|
||||
/* Create shells to make zip format packages. */
|
||||
$shellList = array();
|
||||
foreach(array('zh-cn', 'en') as $langType)
|
||||
{
|
||||
/* Init vars. */
|
||||
$packPrefix = $langType == 'zh-cn' ? 'ZenTaoPMS' : 'ZenTaoALM';
|
||||
$version = $langType == 'zh-cn' ? $pmsVersion : $pmsVersion . '.int';
|
||||
$dirName = $langType == 'zh-cn' ? 'zentaopms' : 'zentaoalm';
|
||||
if(!empty($liteVersion)) $liteVersionAB = $langType == 'zh-cn' ? $liteVersion : $liteVersion . '.int';
|
||||
|
||||
/* Cycle the php versions. */
|
||||
foreach(array('5.3_5.6', '7.0', '7.1', '7.2_7.4', '8.0') as $phpVersion)
|
||||
{
|
||||
/* File name. */
|
||||
$workDir = "tmp/$packPrefix.{$version}.{$phpVersion}/";
|
||||
$shellName = $workDir . "make.sh";
|
||||
echo "Creating $shellName\n";
|
||||
|
||||
mkdir($workDir, 0777, true);
|
||||
|
||||
/* The commands of the shell. */
|
||||
$command = "cd $workDir\n";
|
||||
$command .= "if [ ! -d ../$dirName ]; then unzip ../../$packPrefix.{$version}.zip -d ../ ; fi\n";
|
||||
$command .= "cp -rf ../$dirName .\n";
|
||||
$command .= "unzip ../../zentaobiz.php{$phpVersion}.zip -d $dirName/extension/\n";
|
||||
$command .= "unzip ../../zentaomax.php{$phpVersion}.zip -d $dirName/extension/\n";
|
||||
$command .= "zip -r ../../$packPrefix.{$version}.php{$phpVersion}.zip $dirName\n";
|
||||
|
||||
if(!empty($liteVersion))
|
||||
{
|
||||
$command .= "cd $dirName/config/ext; touch visions.php; echo '<?php\n\$config->visions = \",lite,\";' > visions.php\n";
|
||||
$command .= "echo $liteVersionAB > $dirName/VERSION\n";
|
||||
$command .= "zip -r ../../$packPrefix.{$liteVersionAB}.php{$phpVersion}.zip $dirName\n";
|
||||
}
|
||||
|
||||
$command .= "rm -rf $dirName/\n";
|
||||
|
||||
file_put_contents($shellName, $command);
|
||||
|
||||
$shellList[] = $shellName;
|
||||
}
|
||||
}
|
||||
|
||||
/* Execute the shells. */
|
||||
$lines = '';
|
||||
foreach($shellList as $shellName)
|
||||
{
|
||||
echo $shellName . "\n";
|
||||
$lines .= "sh $shellName &\n";
|
||||
}
|
||||
$lines .= "wait\necho 'Zip packages has done.'";
|
||||
file_put_contents('zip.sh', $lines);
|
||||
Reference in New Issue
Block a user