Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deploytool

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deploytool - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

lib/cmd.js

43

index.js

@@ -5,9 +5,36 @@ /**

module.exports = {
cmdList: require('./lib/cmd-list'),
deploy: require('./lib/deploy'),
environment: require('./lib/environment'),
execute: require('./lib/execute'),
firstCommit: require('./lib/first-commit'),
previousCommit: require('./lib/previous-commit')
};
var use = require('use-plugin')({
"module": module,
"prefix": 'deploytool',
"builtin": './plugins'
});
var plugins = {};
module.exports = {};
function usePlugin(pluginName) {
if (plugins[pluginName]) {
return plugins[pluginName];
}
var pluginDescription = use(pluginName);
pluginDescription.init();
plugins[pluginName] = pluginDescription;
return pluginDescription;
}
// Set up exposed utility functions
module.exports.use = usePlugin;
module.exports.cmd = require('./lib/cmd');
module.exports.cmdList = require('./lib/cmd-list');
module.exports.cmdList = require('./lib/environment');
module.exports.firstCommit = require('./lib/first-commit');
module.exports.previousCommit = require('./lib/previous-commit');
// Load core plugins
var deployPlugin = usePlugin("deploy");
module.exports.deploy = require(deployPlugin.requirepath).deploy;

2

lib/cmd-list.js

@@ -8,3 +8,3 @@ /**

var async = require('async');
var execute = require('./execute');
var execute = require('./cmd');

@@ -11,0 +11,0 @@ module.exports = function (commands, callback) {

@@ -7,9 +7,15 @@ /**

// Private
var objectAssign = require('object-assign');
var yaml_config = require('node-yaml-config');
module.exports = DeployToolEnvironment;
// Public
module.exports = DeploytoolEnvironment;
function DeployToolEnvironment(id, config) {
var defaults = { branch: 'master', remote: 'origin', name: id };
function DeploytoolEnvironment(id, config, defaults) {
defaults = objectAssign({
branch: 'master',
remote: 'origin',
name: id
}, defaults || {});

@@ -20,7 +26,25 @@ this.id = id;

DeployToolEnvironment.initialize = function (idOrEnv, defaults) {
DeploytoolEnvironment.prototype.applyDefaults = function (defaults) {
this.config = objectAssign(defaults, this.config);
return env.config;
};
DeploytoolEnvironment.prototype.validate = function (required, callback) {
var error = null;
required.forEach(function (key) {
if (!this.config[key]) {
error = new Error('Environment key ' + key + ' is required but not set');
}
}, this);
callback(error, !error);
};
DeploytoolEnvironment.init = function (idOrEnv, defaults) {
var environment = idOrEnv;
if (typeof environment === 'string') {
environment = DeployToolEnvironment.load(environment);
environment = DeploytoolEnvironment.load(environment);
}

@@ -35,7 +59,10 @@

DeployToolEnvironment.load = function(id, configFile, defaults, configDir) {
configDir = configDir || __dirname;
configFile = configFile || '.deploytool.yml';
DeploytoolEnvironment.load = function (id, options) {
options = objectAssign({
configFile: '.deploytool.yml',
configDir: __dirname,
defaults: {}
}, options);
var path = configDir + '/' + configFile;
var path = options.configDir + '/' + options.configFile;
var config = yaml_config.load(path);

@@ -47,11 +74,3 @@

return new DeployToolEnvironment(id, config, defaults);
return new DeploytoolEnvironment(id, config, options.defaults);
};
DeployToolEnvironment.create = function(id, config, defaults) {
return new DeployToolEnvironment(id, config, defaults);
};
DeployToolEnvironment.applyDefaults = function(defaults) {
this.config = objectAssign(defaults, this.config);
};
{
"name": "deploytool",
"version": "0.1.1",
"version": "0.2.0",
"description": "A Node tool for deploying things like code to places like remote servers and services",

@@ -25,8 +25,9 @@ "license": "MIT",

},
"keywords": [
],
"keywords": [],
"dependencies": {
"async": "^2.0.0-rc.6",
"eraro": "^0.4.1",
"node-yaml-config": "0.0.4",
"object-assign": "^4.1.0"
"object-assign": "^4.1.0",
"use-plugin": "^0.3.1"
},

@@ -33,0 +34,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc