Private GIT

Skip to content
Snippets Groups Projects
Select Git revision
  • 3824d7c48ea0ba3efbda67b0e42cc1a4b6a08f21
  • master default protected
  • fix_nzb_cat
  • develop
  • guessit2-minimal
  • ssl_warning
  • UHD-qualities
  • fix_providers8
  • !
  • tvvault
  • provider_alpharatio
  • v5.1.1
  • v5.1
  • v5.0.3
  • v5.0.2
  • v5.0.1
  • v5.0
  • v4.2.1.07
  • v4.2.1.06
  • v4.2.1.05
  • v4.2.1.04
  • v4.2.1.03
  • v4.2.1.02
  • v4.2.1.01
  • v4.2.1.0
  • v4.2.0.6
  • v4.2.0.5
  • v4.2.0.4
  • v4.2.0.3
  • v4.2.0.2
  • v4.2.0.1
31 results

Gruntfile.js

Blame
  • Gruntfile.js 19.75 KiB
    'use strict';
    
    module.exports = function(grunt) {
        grunt.registerTask('default', [
            'clean',
            'bower',
            'bower_concat',
            'copy',
            'uglify',
            'sass',
            'cssmin',
            'jshint',
            'mocha'
        ]);
    
        grunt.registerTask('travis', 'Alias for "jshint", "mocha" tasks.', function(update) {
            if (!update) {
                grunt.task.run([
                    'jshint',
                    'mocha'
                ]);
            } else {
                if (process.env.TRAVIS) {
                    grunt.log.writeln('Running grunt and updating translations...'.magenta);
                    grunt.task.run([
                        // 'exec:git:checkout:master', // should be on 'master' branch
                        'default', // Run default task
                        'update_trans', // Update translations
                        'exec:commit_changed_files:yes', // Determine what we need to commit if needed, stop if nothing to commit.
                        'exec:git:"reset --hard"', // Reset unstaged changes (to allow for a rebase)
                        'exec:git:checkout:develop', 'exec:git:rebase:master', // FF develop to the updated master
                        'exec:git_push:origin:"master develop"' // Push master and develop
                    ]);
                } else {
                    grunt.fatal('This task is only for Travis-CI!');
                }
            }
        });
    
        grunt.registerTask('update_trans', 'Update translations', function() {
            grunt.log.writeln('Updating translations...'.magenta);
            var tasks = [
                'exec:babel_extract',
                'exec:babel_update',
                // + crowdin
                'exec:babel_compile',
                'po2json'
            ];
            if (process.env.CROWDIN_API_KEY) {
                tasks.splice(2, 0, 'exec:crowdin_upload', 'exec:crowdin_download'); // insert items at index 2
            } else {
                grunt.log.warn('Environment variable `CROWDIN_API_KEY` is not set, not syncing with Crowdin.'.bold);
            }
    
            grunt.task.run(tasks);
        });
    
        /****************************************
        *  Admin only tasks                     *
        ****************************************/
        grunt.registerTask('publish', 'ADMIN: Create a new release tag and generate new CHANGES.md', [
            'travis',
            'newrelease', // Pull and merge develop to master, create and push a new release
            'genchanges' // Update CHANGES.md
        ]);
    
        grunt.registerTask('newrelease', "Pull and merge develop to master, create and push a new release", [
            'exec:git:checkout:develop', 'exec:git:pull', // Pull develop
            'exec:git:checkout:master', 'exec:git:pull', // Pull master
            'exec:git:merge:develop', // Merge develop into master