Rename config var env to runenv

troubleshooting staging build
pull/1288/head
Nicklas Gummesson 10 years ago
parent 1428ad0125
commit 5eb1992e33

@ -14,7 +14,7 @@
var ASSETS_DIR = './public/assets/<%= pkg.version %>';
// use grunt --environment production
var env = grunt.option('environment') || 'development';
var runenv = grunt.option('environment') || 'development';
var aws = {};
if (grunt.file.exists('./lib/build/grunt-aws.json')) {
@ -25,7 +25,7 @@
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
aws: aws,
env: grunt.file.readJSON("./lib/build/config/" + env + ".json"),
runenv: grunt.file.readJSON("./lib/build/config/" + runenv + ".json"),
gitrev: exec('git rev-parse HEAD', { silent:true }).output.replace('\n', ''),
assets_dir: ASSETS_DIR,

@ -5,10 +5,6 @@ var concatBundles = require('../files/browserify_concat_bundles');
module.exports = {
task: function() {
var watch = '<%= env.browserify.watch %>';
var debug = '<%= env.browserify.debug %>';
var destDir = '<%= assets_dir %>/javascripts/';
var cfg = {
options: {
preBundleCB: function(b) {
@ -35,11 +31,11 @@ module.exports = {
transform: [],
// enables watchify when grunt is run with a watch task, e.g. `grunt browserify watch:js`
watch: watch,
watch: '<%= runenv.browserify.watch %>',
browserifyOptions: {
// if true will include source maps
debug: debug
debug: '<%= runenv.browserify.debug %>'
}
};
@ -52,7 +48,7 @@ module.exports = {
cfg[name] = {
options: options,
src: bundle.src,
dest: bundle.dest || destDir + name +'.js'
dest: bundle.dest || '<%= assets_dir %>/javascripts/' + name +'.js'
}
}
});

@ -14,12 +14,12 @@
cssDir: '<%= assets_dir %>/stylesheets',
fontsDir: '<%= assets_dir %>/fonts',
httpFontsPath: '<%= env.http_path_prefix %>/assets/<%= pkg.version %>/fonts',
httpFontsPath: '<%= runenv.http_path_prefix %>/assets/<%= pkg.version %>/fonts',
imagesDir: 'app/assets/images/',
generatedImagesDir: '<%= assets_dir %>/images/',
httpImagesPath: '<%= env.http_path_prefix %>/assets/<%= pkg.version %>/images/',
httpGeneratedImagesPath: '<%= env.http_path_prefix %>/assets/<%= pkg.version %>/images/',
httpImagesPath: '<%= runenv.http_path_prefix %>/assets/<%= pkg.version %>/images/',
httpGeneratedImagesPath: '<%= runenv.http_path_prefix %>/assets/<%= pkg.version %>/images/',
environment: 'production',
outputStyle: 'compressed',

@ -21,7 +21,7 @@
// Change all routes from img to asset version path
process: function (content, srcpath) {
// return content.replace(/\.\.\/img/gi,"/assets/<%= pkg.version %>/images/themes");
var path = grunt.template.process("<%= env.http_path_prefix %>/assets/<%= pkg.version %>/images/themes")
var path = grunt.template.process("<%= runenv.http_path_prefix %>/assets/<%= pkg.version %>/images/themes")
return content.replace(/\.\.\/img/gi, path);
}
}

@ -13,7 +13,7 @@ module.exports = {
var mapping = grunt.file.expandMapping(s);
var manifest = assets.replace(version, '') + "/manifest.yml"
var minify_js = grunt.config.get('env').use_minify;
var minify_js = grunt.config.get('runenv').use_minify;
grunt.file.write(manifest, "---\n" + mapping.filter(function(s) {
return !grunt.file.isDir(s.src[0]);

Loading…
Cancel
Save