skuid-grunt individual page

  • 1
  • Question
  • Updated 1 year ago
  • Answered
Is there an easy way to set up a grunt task so that I can push specific pages back to the server?

I'd like to do something like this:

grunt.initConfig({
'skuid-push':{      'options': orgOptions,
      'production':{
         'files':{
            src: ['skuidpages/Optimize*', 'skuidpages/Cleanup*']
         }
      }
      'specific':{
        'files':{
          src: ['skuidpages/' + n]
        }
      }
    } });
grunt.registerTask('push-specific-page', ['skuid-push:specific']);
And then run something like this in the console:
grunt skuid-push:specific("Module1_PageName");

But it's not clear to me if there's actually a way to do that without hard-coding the page into the gruntfile each time. Any pointers on this?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Matt - Take a look at grunt.option (http://gruntjs.com/api/grunt.option).  I think this should give you what you are looking for.
Photo of Ethan Rogers

Ethan Rogers

  • 272 Points 250 badge 2x thumb
Matt,
Barry is correct. grunt.option would be your best bet. You're snippet above wouldn't have change much at all. 

grunt.initConfig({
'skuid-push':{'options': orgOptions,
      'production':{
         'files':{
            src: ['skuidpages/Optimize*', 'skuidpages/Cleanup*']
         }
      }
      'specific':{
        'files':{
          src: ['skuidpages/' + grunt.option('page')]
        }
      }
    } });

This will give you the ability to push any single or number of pages that you specify at runtime.  The command would look something like this:
grunt skuid-push:specific --page="Module_SomeSinglePage.xml"
or
grunt skuid-push:specific --page="AllPagesInModule_*"
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Thanks, Ethan.
Photo of Janet

Janet

  • 60 Points
Matt, is it possible to set up a grunt task to pull down page by page?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Not that I'm aware of. @Ethan?