docs: function (serviceDir, selectedConfiguration) {
      if (!serviceDir.startsWith('/')) {
        throw new Error(`serviceDir (${serviceDir}) must be absolute path.`);
      }
  
      // Create services folder if it doesn't exist.
      if (!fs.existsSync(serviceDir)) {
        fs.mkdirSync(serviceDir);
      }
  
      // Names of all the services (must have directory serviceName/config)
      var serviceNames = _.filter(fs.readdirSync(serviceDir), function(fileName) {
        var serviceConfigPath = path.join(serviceDir, fileName, 'config');
        try {
          return fs.lstatSync(serviceConfigPath).isDirectory();
        } catch (err) {
          return false;
        }
      });
  
      return _.map(serviceNames, function (serviceName) {
        var servicePath = path.join(serviceDir, serviceName);
        var configurationPath = path.join(servicePath, 'config', selectedConfiguration);
        var configuration = null;
  
        if (!configurationPath.startsWith('/')) {
          configurationPath = './' + configurationPath;
        }
  
        try {
          configuration = require(configurationPath);
          configuration = configuration.default || configuration;
  
          // pass directories etc. to configuration
          if (_.isFunction(configuration)) {
            configuration = configuration({
              servicePath: servicePath
            });
          }
        } catch (err) {
          // rethrow if the error was not about missing module
          if ( err.code !== 'MODULE_NOT_FOUND' ) {
              throw err;
          }
          // ignore missing module errors silently, maybe given profile was not defined for
          // the service, which is totally cool... no prob bro!
        }
  
        var tasks = [];
        if (configuration) {
          // TODO: move these tasks to separate file and test that they do what they should
          tasks.push({
            name: 'serve',
            run: function () {
              var app = require('../app/express/main');
              return app.start(configuration);
            },
            description: 'Start the express app of the service.'
          });
  
          // add tasks declared by features to build
          var features = plugins.loadFeatures(configuration);
          _.each(features, function(featureDescription) {
            _.each(featureDescription.tasks, function (task) {
              // wrap task runner function to closure which passes required parameters  to call, which takes only global configuration as parameter and pass feature config implicitly
              tasks.push({
                name: task.name,
                description: task.description,
                run: function () {
                  return task.run(featureDescription.featureDef.config, configuration, servicePath);
                }
              });
            });
          });
        }
  
        return {
          name: serviceName,
          configPath: configurationPath,
          config: configuration,
          tasks: tasks
        };
      });
    }