mirror of
				https://github.com/Mibew/mibew.git
				synced 2025-11-04 04:15:19 +03:00 
			
		
		
		
	Add new gulp tasks
New tasks intends to automate the process of release uploading to CDN
This commit is contained in:
		
							parent
							
								
									de782c7fea
								
							
						
					
					
						commit
						dfaaffcff4
					
				@ -43,6 +43,7 @@ var config = {
 | 
			
		||||
    i18nPath: 'i18n',
 | 
			
		||||
    i18nPrefix: 'mibew-i18n-',
 | 
			
		||||
    releasePath: 'release',
 | 
			
		||||
    uploadPath: 'upload',
 | 
			
		||||
    compiledTemplatesHeader: fs.readFileSync('tools/compiled_templates_header.txt'),
 | 
			
		||||
    getComposerUrl: 'https://getcomposer.org/installer',
 | 
			
		||||
    phpBin: 'php -d "suhosin.executor.include.whitelist = phar" -d "memory_limit=512M"',
 | 
			
		||||
@ -377,6 +378,25 @@ gulp.task('pack-i18n', function(callback) {
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
gulp.task('prepare-for-upload', function(callback) {
 | 
			
		||||
    gulp.src(config.releasePath + '/mibew-' + config.package.version + '.*')
 | 
			
		||||
        .pipe(gulp.dest(config.uploadPath + '/core/' + config.package.version + '/'));
 | 
			
		||||
 | 
			
		||||
    gulp.src(config.releasePath + '/mibew-i18n-translation-' + config.package.version + '-*.pot')
 | 
			
		||||
        .pipe(gulp.dest(config.uploadPath + '/i18n/_pot/' + config.package.version + '/'));
 | 
			
		||||
 | 
			
		||||
    return getChildDirs(config.i18nPath + '/translations')
 | 
			
		||||
           .then(function (dirs) {
 | 
			
		||||
                return Promise.all(dirs.map(function (dir) {
 | 
			
		||||
                    return new Promise(function(resolve, reject) {
 | 
			
		||||
                        gulp.src(config.releasePath + '/mibew-i18n-' + dir + '-' + config.package.version + '-*.*')
 | 
			
		||||
                            .pipe(gulp.dest(config.uploadPath + '/i18n/' + dir + '/' + config.package.version + '/'))
 | 
			
		||||
                            .on('error', reject)
 | 
			
		||||
                            .on('end', resolve);
 | 
			
		||||
                    });
 | 
			
		||||
                }));
 | 
			
		||||
           });
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
gulp.task('clean-tmp-po', function() {
 | 
			
		||||
    return del([config.releasePath + '/translation.po']);
 | 
			
		||||
@ -390,6 +410,15 @@ gulp.task('clean-tmp-i18n-files', function() {
 | 
			
		||||
    ]);
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
gulp.task('clean-upload', function(callback) {
 | 
			
		||||
    return del([config.uploadPath], callback);
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
gulp.task('clean-all', function(callback) {
 | 
			
		||||
    runSequence( ['clean', 'clean-upload'],
 | 
			
		||||
                 callback );
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
gulp.task('prepare-i18n-release', function(callback) {
 | 
			
		||||
    runSequence( 'clean-tmp-po',
 | 
			
		||||
                 'generate-pos',
 | 
			
		||||
@ -489,6 +518,16 @@ gulp.task('prepare-release', function(callback) {
 | 
			
		||||
    );
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
gulp.task('prepare-all', function(callback) {
 | 
			
		||||
    runSequence(
 | 
			
		||||
        'clean-all',
 | 
			
		||||
        'prepare-release',
 | 
			
		||||
        'prepare-i18n-release',
 | 
			
		||||
        'prepare-for-upload',
 | 
			
		||||
        callback
 | 
			
		||||
    );
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// Prepares ready to use development version of Mibew without packing or
 | 
			
		||||
// validating it.
 | 
			
		||||
gulp.task('rebuild', function(callback) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user