Pass command line variables to Grunt
In gruntfile.js
gruntfile.js
var target = grunt.option('target') || 'dev';
On the command line
grunt deploy --target=staging
See http://gruntjs.com/api/grunt.option