Nikita

Automation and deployment solution

Built for Node.js, MIT License

Deploy apps and infrastructures

Get startedChangelog

Main library features

Consistent Usage

All the functions share the same API, accepting options and a user callback in a flexible manner. Once you learn the core usage, you only learn the options of the actions you wish to execute.

Everything is a file

No agent to install, no database to depends on. Your project is just another Node.js package easily versionned in Git and any SCM, easily integrated with your CI and CD DevOps tools.

Idempotence

Call a function multiple times and expect the same result. You’ll be informed of any modifications and can retrieve defailed information.

Documentation

Learn fast. Source code is self-documented with the most commons usages enriched by many examples. Don’t forget to look at the tests as well.

Flexibility

Deliberatly sacrifying speed for a maximum of strength, ease of use and flexibility. The simple API allows us to constantly add new functionnality without affecting the API.

Composition

Built from small and reusable actions imbracated into complex system. It follows the Unix philosophie of building small small single-building blocks with a clear API.

SSH support

All the functions run transparently over SSH. Look at the tests, they are all executed both locally and remotely.

Reporting

Advanced reports can be optained by providing a log function, listening to stdout and stderr streams, generating diffs and backups.

Reliability

Feel confident. The modules are used in production for years and the code is enforced by an extensive test coverage.

Suppport

The package is open sourced with one of the least restrictive license. Involve yourself and contributes to open source development by sending push requests or requesting commercial support offered by Adaltas .

Example installation of Redis

// User configuration
const options = {
  // url: 'http://download.redis.io/redis-stable.tar.gz',
  // config: {
  //   bind: '127.0.0.1',
  //   port: 6379,
  //   ...
  // }
}
// Nikita instantiation
require('nikita')
// Activate CLI reporting
.log.cli()
// Define and execute a custom Redis action
.call(options, header: 'Redis', function(options){
  // Default optionsr
  if(!options.url){ options.url = 'http://download.redis.io/redis-stable.tar.gz' }
  if(!options.config){ options.config = {} }
  if(!options.config['bind']){ options.config['bind'] = '127.0.0.1' }
  if(!options.config['protected-mode']){ options.config['protected-mode'] = 'yes' }
  if(!options.config['port']){ options.config['port'] = 6379 }
  // Do the job
  this
  .file.download({
    header: 'Download',
    source: options.url,
    target: 'cache/redis-stable.tar.gz'
  })
  .system.execute({
    header: 'Compilation',
    unless_exists: 'redis-stable/src/redis-server',
    cmd: `
    tar xzf cache/redis-stable.tar.gz
    cd redis-stable
    make
    `
  })
  .file.properties({
    header: 'Configuration',
    target: 'conf/redis.conf',
    separator: ' ',
    content: options.config
  })
  .system.execute({
    header: 'Startup',
    code_skipped: 3,
    cmd: `
    ./src/redis-cli ping && exit 3
    nohup ./redis-stable/src/redis-server conf/redis.conf &
    `
  })
})