Merge branch 'hotfix/5.7.10'

This commit is contained in:
Yuri Kuznetsov
2019-12-13 13:23:11 +02:00
5 changed files with 319 additions and 742 deletions
+71 -24
View File
@@ -93,6 +93,9 @@ module.exports = function (grunt) {
var fs = require('fs');
var cp = require('child_process');
var path = require('path');
var currentPath = path.dirname(fs.realpathSync(__filename));
var themeList = [];
fs.readdirSync('application/Espo/Resources/metadata/themes').forEach(function (file) {
@@ -118,8 +121,10 @@ module.exports = function (grunt) {
lessData[theme] = o;
});
var pkg = grunt.file.readJSON('package.json');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
pkg: pkg,
mkdir: {
tmp: {
@@ -135,8 +140,13 @@ module.exports = function (grunt) {
clean: {
start: ['build/EspoCRM-*'],
final: ['build/tmp'],
release: ['build/EspoCRM-' + pkg.version],
beforeFinal: {
src: ['build/tmp/custom/Espo/Custom/*', '!build/tmp/custom/Espo/Custom/.htaccess', 'build/tmp/install/config.php']
src: [
'build/tmp/custom/Espo/Custom/*',
'!build/tmp/custom/Espo/Custom/.htaccess',
'build/tmp/install/config.php',
]
}
},
less: lessData,
@@ -156,6 +166,9 @@ module.exports = function (grunt) {
})
},
copy: {
options: {
mode: true,
},
frontendFolders: {
expand: true,
cwd: 'client',
@@ -217,9 +230,6 @@ module.exports = function (grunt) {
},
},
chmod: {
options: {
mode: '755'
},
php: {
options: {
mode: '644'
@@ -248,7 +258,21 @@ module.exports = function (grunt) {
'build/EspoCRM-<%= pkg.version %>/api/v1/portal-access',
'build/EspoCRM-<%= pkg.version %>',
]
}
},
foldersWritable: {
options: {
mode: '775'
},
src: [
'build/EspoCRM-<%= pkg.version %>/data',
'build/EspoCRM-<%= pkg.version %>/custom',
'build/EspoCRM-<%= pkg.version %>/custom/Espo',
'build/EspoCRM-<%= pkg.version %>/custom/Espo/Custom',
'build/EspoCRM-<%= pkg.version %>/client/custom',
'build/EspoCRM-<%= pkg.version %>/client/modules',
'build/EspoCRM-<%= pkg.version %>/application/Espo/Modules',
]
},
},
replace: {
version: {
@@ -268,17 +292,10 @@ module.exports = function (grunt) {
]
}
},
compress: {
final: {
options: {
archive: 'build/EspoCRM-<%= pkg.version %>.zip',
mode: 'zip'
},
src: ['**'],
cwd: 'build/EspoCRM-<%= pkg.version %>',
dest: 'EspoCRM-<%= pkg.version %>'
}
}
});
grunt.registerTask("chmod-folders", function() {
cp.execSync("find . -type d -exec chmod 755 {} + ", {stdio: 'ignore', cwd: 'build/EspoCRM-' + pkg.version});
});
grunt.registerTask("composer", function() {
@@ -289,15 +306,41 @@ module.exports = function (grunt) {
cp.execSync("node diff --all --vendor", {stdio: 'inherit'});
});
grunt.registerTask("unitTests", function() {
grunt.registerTask("unit-tests", function() {
cp.execSync("phpunit --bootstrap=vendor/autoload.php tests/unit", {stdio: 'inherit'});
});
grunt.registerTask("integrationTests", function() {
grunt.registerTask("integration-tests", function() {
cp.execSync("phpunit --bootstrap=vendor/autoload.php tests/integration", {stdio: 'inherit'});
});
grunt.registerTask("zip", function() {
var fs = require('fs');
var resolve = this.async();
var folder = 'EspoCRM-' + pkg.version;
var zipPath = 'build/' + folder +'.zip';
if (fs.existsSync(zipPath)) fs.unlinkSync(zipPath);
var archiver = require('archiver');
var archive = archiver('zip');
archive.on('error', function (err) {
grunt.fail.warn(err);
});
var zipOutput = fs.createWriteStream(zipPath);
zipOutput.on('close', function () {
console.log("EspoCRM package has been built.");
resolve();
});
archive.directory(currentPath + '/build/' + folder, folder).pipe(zipOutput);
archive.finalize();
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-mkdir');
grunt.loadNpmTasks('grunt-contrib-less');
@@ -305,7 +348,6 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-chmod');
grunt.registerTask('offline', [
@@ -320,7 +362,10 @@ module.exports = function (grunt) {
'replace',
'clean:beforeFinal',
'copy:final',
'chmod',
'chmod-folders',
'chmod:php',
'chmod:folders',
'chmod:foldersWritable',
'clean:final',
]);
@@ -332,12 +377,14 @@ module.exports = function (grunt) {
grunt.registerTask('release', [
'default',
'upgrade',
'zip',
'clean:release',
]);
grunt.registerTask('tests', [
'default',
'unitTests',
'integrationTests',
'unit-tests',
'integration-tests',
]);
grunt.registerTask('dev', [
+3 -3
View File
@@ -56,9 +56,9 @@ Before we can merge your pull request you need to accept our CLA [here](https://
Branches:
* hotfix/* upcoming maintenance release; fixes should be pushed to this branch;
* master develop branch; new features should be pushed to this branch;
* stable last stable release.
* *hotfix/** upcoming maintenance release; fixes should be pushed to this branch;
* *master* develop branch; new features should be pushed to this branch;
* *stable* last stable release.
### Running tests (for developers)
+2 -2
View File
@@ -236,10 +236,10 @@ function buildUpgradePackage(versionFrom, params)
});
if (beforeUpgradeFileList.length) {
cp.execSync('xargs -a ' + diffBeforeUpgradeFolderPath + ' cp --parents -t ' + upgradePath + '/beforeUpgradeFiles');
cp.execSync('xargs -a ' + diffBeforeUpgradeFolderPath + ' cp -p --parents -t ' + upgradePath + '/beforeUpgradeFiles');
}
execute('xargs -a ' + diffFilePath + ' cp --parents -t ' + upgradePath + '/files' , function (stdout) {
execute('xargs -a ' + diffFilePath + ' cp -p --parents -t ' + upgradePath + '/files' , function (stdout) {
var d = new Date();
var monthN = ((d.getMonth() + 1).toString());
+240 -708
View File
File diff suppressed because it is too large Load Diff
+3 -5
View File
@@ -10,11 +10,11 @@
"author": "",
"license": "GPL-3.0",
"devDependencies": {
"archiver": "^3.1.1",
"fstream": ">=1.0.12",
"grunt": "~1.0.3",
"grunt": "^1.0.4",
"grunt-chmod": "~1.1.0",
"grunt-contrib-clean": "~2.0.0",
"grunt-contrib-compress": "~1.4.3",
"grunt-contrib-concat": "~1.0.1",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-cssmin": "~3.0.0",
@@ -26,7 +26,5 @@
"pofile": "~1.0.11",
"tar": "^4.4.8"
},
"dependencies": {
"archiver": "^3.1.1"
}
"dependencies": {}
}