How to use the azk.config function in azk

To help you get started, we’ve selected a few azk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github azukiapp / azk / src / utils / docker.js View on Github external
  static resolvePath(target, point = config('agent:vm:mount_point')) {
    target = Utils.resolve(target);
    if (config('agent:requires_vm')) {
      target = path.join(point, target);
    }

    return target;
  }
}
github azukiapp / azk / src / manifest / system.js View on Github external
get persistent_folders() {
    var folders = {};
    var key  = config('agent:requires_vm') ? 'agent:vm' : 'paths';
    var base = config(key + ':persistent_folders');

    return _.reduce(this.options.persistent_folders, (folders, folder) => {
      var origin = path.join(base, this.manifest.namespace, this.name, folder);
      folders[origin] = folder;
      return folders;
    }, {});
  }
github azukiapp / azk / src / cmds / init.js View on Github external
return async(this, function* () {
      if (params.filename) {
        this.showFilename();
        return 0;
      }

      var generator = new lazy.Generator(this.ui);
      var manifest  = config("manifest");
      var cwd  = params.path || this.cwd;
      var file = path.join(cwd, manifest);

      var manifest_exists = yield fsAsync.exists(file);
      if (manifest_exists && !params.force) {
        this.ui.fail(this.ui.tKeyPath(this.name, "already_exists"), manifest);
        return 1;
      }

      var systemsData = yield generator.findSystems(cwd);
      log.debug('generator.findSystems(\'%s\')', cwd);

      if (_.isEmpty(systemsData)) {
        this.ui.fail(this.ui.tKeyPath(this.name, "not_found"));
        systemsData = { [lazy.example_system.name]: lazy.example_system };
      }
github azukiapp / azk / spec / agent / vm_spec.js View on Github external
describe("with a vm is running", function() {
    this.timeout(10000);
    var name = config("agent:vm:name");
    var data = "";
    var _subscription;

    before(() => {
      _subscription = subscribe('agent.#', (event) => {
        if (event.type == "ssh" && (event.context == "stdout" || event.context == "stderr")) {
          data += event.data.toString();
        }
      });
    });
    after(() => {
      _subscription.unsubscribe();
    });

    beforeEach(() => {
      data = "";
github azukiapp / azk / src / utils / net.js View on Github external
var portscanner = require('portscanner');
var url         = require('url');
var nativeNet   = require('net');
var os          = require('os');

var { isIPv4 }  = require('net');

var lazy = lazy_require({
  Netmask      : ['netmask'],
  hostonly     : ['azk/agent/vm'],
  VM           : ['azk/agent/vm'],
  connectivity : 'connectivity',
  nodeRetry    : 'retry',
});

var portrange = config("agent:portrange_start");
var cache_key = "agent:dns:file_cache";

var net = {
  getPort(host = 'localhost') {
    var port   = portrange;
    portrange += 1;

    return this
      .checkPort(port, host)
      .then((avaibly) => {
        return (avaibly) ? port : this.getPort(host);
      });
  },

  checkPort(port, host = 'localhost') {
    return ninvoke(portscanner, "checkPortStatus", port, host)

azk

ISC
Latest version published 7 years ago

Package Health Score

40 / 100
Full package analysis

Similar packages