drone-runtime

command module
v0.0.0-...-3e8bd99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

README

The drone runtime package implements the execution model for container-based pipelines. It is effectively a lightweight container orchestration engine optimized for pipelines.

Definition File

The runtime package accepts a pipeline definition file as input, which is a simple json file. This file is not intended to be read or written by humans. It is considered an intermediate representation, and should be generated by a computer program from more user-friendly formats such a yaml.

Example hello world definition file:

{
  "version": 1,
  "pipeline": [
    {
      "name": "stage_0",
      "alias": "stage_0",
      "steps": [
        {
          "name": "step_0",
          "alias": "step_0",
          "image": "alpine:3.6",
          "working_dir": "/",
          "entrypoint": [
            "/bin/sh",
            "-c"
          ],
          "command": [
            "echo hello world"
          ],
          "on_success": true
        }
      ]
    }
  ],
  "networks": [ ],
  "volumes": [ ]
}

Local Testing

The runtime package includes a simple command line utility allowing you to test pipeline execution locally. You should use this for local development and testing.

The runtime package includes sample definition files that you can safely execute on any machine with Docker installed. These sample files should be used for research and testing purposes.

Example commands:

drone-runtime samples/1_hello_world.json
drone-runtime samples/2_on_success.json
drone-runtime samples/3_on_failure.json
drone-runtime samples/4_volume_read_write.json
drone-runtime samples/5_redis.json
drone-runtime samples/6_redis_multi.json
drone-runtime samples/7_postgres.json
drone-runtime --chroot=/tmp/drone samples/8_backup_restore.json 
drone-runtime --chroot=/tmp/drone samples/9_restore.json

Runtime Engines

The default runtime engine targets Docker, but can be extended using plugins. The plugin loader expects your custom engine is exposed using the following convention:

package main

import "github.com/drone/drone-runtime/engine"

func Engine() (engine.Engine, error) {
  // return your custom engine implementation
}

Test your plugin using the command line utility:

drone-runtime --plugin=custom/plugin.so samples/1_hello_world.json

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL