Config and login
Change-Id: I81ffb9b8097620cb7870beaf1b1b315945eebec0
diff --git a/gulp_tasks/karma.js b/gulp_tasks/karma.js
index 98aaf1d..5b90572 100644
--- a/gulp_tasks/karma.js
+++ b/gulp_tasks/karma.js
@@ -1,5 +1,3 @@
-process.env.NODE_ENV = 'test';
-
 const path = require('path');
 
 const gulp = require('gulp');
@@ -15,12 +13,14 @@
 }
 
 function karmaSingleRun(done) {
+  process.env.NODE_ENV = 'test';
   const configFile = path.join(process.cwd(), 'conf', 'karma.conf.js');
   const karmaServer = new karma.Server({configFile}, karmaFinishHandler(done));
   karmaServer.start();
 }
 
 function karmaAutoRun(done) {
+  process.env.NODE_ENV = 'test';
   const configFile = path.join(process.cwd(), 'conf', 'karma-auto.conf.js');
   const karmaServer = new karma.Server({configFile}, karmaFinishHandler(done));
   karmaServer.start();
diff --git a/gulp_tasks/misc.js b/gulp_tasks/misc.js
index 6cc14bc..efd2cca 100644
--- a/gulp_tasks/misc.js
+++ b/gulp_tasks/misc.js
@@ -3,16 +3,39 @@
 const gulp = require('gulp');
 const del = require('del');
 const filter = require('gulp-filter');
+const rename = require("gulp-rename");
 
 const conf = require('../conf/gulp.conf');
+const cfgFolder = path.join(conf.paths.src, 'app/config');
 
 gulp.task('clean', clean);
 gulp.task('other', other);
+gulp.task('brand', styleConfig);
+gulp.task('appConfig', appConfig);
+gulp.task('config', gulp.series('brand', 'appConfig'));
 
 function clean() {
   return del([conf.paths.dist, conf.paths.tmp]);
 }
 
+function appConfig() {
+  const env = process.env.NODE_ENV || 'production';
+  return gulp.src([
+    path.join(conf.paths.appConfig, `app.config.${env}.ts`)
+  ])
+  .pipe(rename('app.config.ts'))
+  .pipe(gulp.dest(cfgFolder));
+}
+
+function styleConfig() {
+  const env = process.env.BRAND || 'cord';
+  return gulp.src([
+    path.join(conf.paths.appConfig, `style.config.${env}.ts`)
+  ])
+  .pipe(rename('style.config.ts'))
+  .pipe(gulp.dest(cfgFolder));
+}
+
 function other() {
   const fileFilter = filter(file => file.stat.isFile());