pipeline

package module
v0.0.0-...-5b70521 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: MIT Imports: 6 Imported by: 0

README

Pipeline

This tool is pipeline framework.

Travis GitHub release MIT License Go Documentation

Built-in Plugins

  • Github Comment
  • Github Pull-Request
  • Slack Notification

Usage

cat << EOF > .pipeline.yml
variables:
  %BRANCH%: $BRANCH
  %BASE%: $BASE
  %ISSUE_ID%: $ISSUE_ID
  %GITHUB_TOKEN%: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
lines:
  parallels:
    - name: build branch
      commands: |
        git checkout -f %BRANCH%
        bin/rspec
        %BRANCH_PERCENT% = cat coverage/.last_run.json | grep covered_percent | awk '{print $2}'"
    - name: build master
      commands: |
        git checkout -f %BASE%
        bin/rspec
        %BASE_PERCENT% = cat coverage/.last_run.json | grep covered_percent | awk '{print $2}'"
  - name: calculate coverage
    commands: |
      %PERCENT% = $(./calculate.sh)
      %COMMENT% = $(./build_comment.sh)
      exit %EXIT_STATUS%
    plugins:
      - github-comment
      - github-pr
  - name: notify to slack
    plugins:
      - slack-notify
EOF

Install

To install, use go get:

$ go get -d github.com/linyows/pipeline

Contribution

  1. Fork (https://github.com/linyows/pipeline/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create a new Pull Request

Author

linyows

Documentation

Index

Constants

View Source
const (
	ExitCodeOK    int = 0
	ExitCodeError int = 1 + iota
)

Exit codes are int values that represent an exit code for a particular error.

View Source
const Name string = "pipeline"

Name for this package

View Source
const Version string = "0.1.0"

Version for this package

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

CLI is structure

func NewCLI

func NewCLI(o io.Writer, e io.Writer, i *os.File) *CLI

NewCLI returns CLI struct

func (*CLI) Run

func (c *CLI) Run(args []string) int

Run invokes the CLI with the given arguments.

type Config

type Config struct {
}

Config is structure

type Options

type Options struct {
	Config  string
	Version bool
}

Options is structure

type Pipeline

type Pipeline struct {
	ConfigPath string
	Data       []byte
	Config     Config
	Lines      []*Tasks
}

Pipeline is structure

func NewPipeline

func NewPipeline() *Pipeline

NewPipeline for pipeline

func (*Pipeline) LoadConfig

func (p *Pipeline) LoadConfig() error

LoadConfig loads a config file

func (*Pipeline) Run

func (p *Pipeline) Run(args []string) int

Run invokes the CLI with the given arguments.

type Task

type Task struct {
	// contains filtered or unexported fields
}

Tasks is structure

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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