Node client for the Drone API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

drone-node

Node client for the Drone API

Client

An API client is included in this package

const Drone = require('drone-node');

const client = new Drone.Client({ url: 'https://your.drone.server.com', token: 'SoMeToKeN' });

client.getRepos().then((repos) => {

  // lists all the repos available to the authenticated user
});

Many methods are available, until they're documented see lib/index.js for details.

Plugins

This package provides utilities for creating plugins. Plugins are command-line programs invoked during the build process. Build information and plugin configuration is passed to the plugin as a command-line argument in JSON format:

node run super_plugin.js -- '{ "build": {"number": 1, "status": "success"} }'

Example usage:

const Drone = require('drone-node');
const plugin = new Drone.Plugin();

plugin.parse().then((params) => {

  // gets build and repository information for
  // the current running build
  const build = params.build;
  const repo  = params.repo;

  // gets plugin-specific parameters defined in
  // the .drone.yml file
  const vargs = params.vargs;
});