<commit_before>module.exports = function(scope, argv, dew) {
  var PostgreSQL = dew.drops['postgresql'](argv, dew);
  var env = {
    SMTP_DOMAIN: 'knban.com',
    SMTP_HOST: 'localhost',
    SMTP_PORT: 25,
    GITLAB_HTTPS: true,
    GITLAB_HTTPS_ONLY: false,
    GITLAB_HOST: 'gitlab.knban.com',
    GITLAB_EMAIL: '<EMAIL>',
    DB_TYPE: 'postgres',
    DB_HOST: null,
    DB_USER: 'gitlab',
    DB_PASS: 'password',
    DB_NAME: 'gitlabhq_production'
  }
  return {
    install: function (done) {
      var pg = new PostgreSQL()
      pg.install(function (err, pgUser, pgPass) {
        if (err) throw new Error(err);
        pg.inspect(function (err, data) {
          var exec = require('child_process').exec
            , newPass = Math.random().toString(26).substring(2)
            , sql = [], script = null, _ = require('lodash')
            , psql = null
            
          env.DB_HOST = data.NetworkSettings.IPAddress;
          sql.push("CREATE ROLE gitlab with LOGIN CREATEDB PASSWORD '"+newPass+"';")
          sql.push("CREATE DATABASE gitlabhq_production;")
          sql.push("GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production to gitlab;")
          script = _.map(sql, function (sql) {
            return 'psql -U '+pgUser+' -d template1 -h '+env.DB_HOST+' --command \"'+sql+'\"';
          }).join('\n');
          exec(script, {env:{PGPASSWORD:pgPass}}, function (err) {
            if (err) throw new Error(err);
            console.log(pg.scope.name+" created gitlab user and database")
          });
        });
        /*
        scope.applyConfig({
          image: 
          image: "sameersbn/gitlab:7.1.1",
          ports: {
            10022: 22,
            10080: 80
          },
          volumes: {
            data: "/home/git/data"
          },
          links: {
            postgresql: 'postgresql'
          },
          env: {
          }
        }, function (err) {
          if (err) throw err;
          scope.tailForever();
        })*/
      });<commit_msg>stub start/setup logic for gitlab<commit_after>module.exports = function(scope, argv, dew) {
  var PostgreSQL = dew.drops['postgresql'](argv, dew);
  var env = {
    SMTP_DOMAIN: 'knban.com',
    SMTP_HOST: 'localhost',
    SMTP_PORT: 25,
    GITLAB_HTTPS: true,
    GITLAB_HTTPS_ONLY: false,
    GITLAB_HOST: 'gitlab.knban.com',
    GITLAB_EMAIL: '<EMAIL>',
    DB_TYPE: 'postgres',
    DB_HOST: null,
    DB_USER: 'gitlab',
    DB_PASS: 'password',
    DB_NAME: 'gitlabhq_production'
  }
  return {
    install: function (done) {
      var pg = new PostgreSQL()
      pg.install(function (err, pgUser, pgPass) {
        if (err) throw new Error(err);
        pg.inspect(function (err, data) {
          var exec = require('child_process').exec
            , newPass = <PASSWORD>.<PASSWORD>().toString(26).substring(2)
            , sql = [], script = null, _ = require('lodash'), psql = null
            
          env.DB_HOST = data.NetworkSettings.IPAddress;
          sql.push("CREATE ROLE gitlab with LOGIN CREATEDB PASSWORD '"+newPass+"';")
          sql.push("CREATE DATABASE gitlabhq_production;")
          sql.push("GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production to gitlab;")
          script = _.map(sql, function (sql) {
            return 'psql -U '+pgUser+' -d template1 -h '+env.DB_HOST+' --command \"'+sql+'\"';
          }).join('\n');
          exec(script, {env:{PGPASSWORD:pgPass}}, function (err) {
            if (err) throw new Error(err);
            console.log(pg.scope.name+" created gitlab user and database")
          });

          if (scope.localStorage.getItem('dbSetup')) {
            start(done)
          } else {
            setup(function () {
              scope.localStorage.setItem('dbSetup', true);
              start(done)
            })
          }
        });
        /*
        scope.applyConfig({
          image: 
          image: "sameersbn/gitlab:7.1.1",
          ports: {
            10022: 22,
            10080: 80
          },
          volumes: {
            data: "/home/git/data"
          },
          links: {
            postgresql: 'postgresql'
          },
          env: {
          }
        }, function (err) {
          if (err) throw err;
          scope.tailForever();
        })*/
      });
{'fraction_non_alphanumeric': 0.14142122487143524, 'fraction_numerical': 0.010752688172043012, 'mean_word_length': 1.8469727212242182, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3788040', 'n_tokens_mistral': 1407, 'n_tokens_neox': 1377, 'n_words': 290}