roer

package module
v0.6.0 Latest Latest
Warning

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

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

README

roer

A thin CLI for Spinnaker.

This project is aimed to provide a thin, limited client that's suitable for CI environments where you may want to publish Pipeline Templates or update pipeline configurations in Spinnaker. For a CLI to help configure and operate use halyard: config & operating utilities are not in Roer's scope.

You can download the most recent version from the Releases tab.

Usage

Export SPINNAKER_API pointing to your Gate API.

NAME:
   roer - Spinnaker CLI

USAGE:
   main [global options] command [command options] [arguments...]

VERSION:
   dev

COMMANDS:
     pipeline           pipeline tasks
     pipeline-template  pipeline template tasks
     help, h            Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --verbose, -v               show debug messages
   --certPath value, -c value  HTTPS x509 cert path
   --keyPath value, -k value   HTTPS x509 key path
   --version                   print the version

Commands

pipeline-template

NAME:
   roer pipeline-template - pipeline template tasks

USAGE:
   roer pipeline-template  command [command options] [arguments...]

VERSION:
   dev

COMMANDS:
     publish  publish a pipeline template
     plan     validate a pipeline template and or plan a configuration
     convert  converts an existing, non-templated pipeline config into a scaffolded template
$ SPINNAKER_API=https://localhost:7002 \
  go run cmd/roer/main.go pipeline-template plan examples/wait-config-invalid.yml
{
  "errors": [
    {
      "location": "configuration:stages.noConfigStanza",
      "message": "Stage configuration is unset",
      "severity": "FATAL"
    },
    {
      "location": "configuration:stages.noConfigStanza",
      "message": "A configuration-defined stage should have either dependsOn or an inject rule defined",
      "severity": "WARN"
    }
  ],
  "message": "Pipeline template is invalid",
  "status": "BAD_REQUEST"
}

Development

Install glide, then install the dependencies:

$ glide i

To run:

$ go run cmd/roer/main.go

Extending

You can extend the interface, as well as inject your own HTTP client by providing your own main.go. This can be useful if you need to provide custom auth logic, or if you want to add new commands, but not contribute them directly to the project.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PipelineSaveAction added in v0.2.0

func PipelineSaveAction(clientConfig spinnaker.ClientConfig) cli.ActionFunc

PipelineSaveAction creates the ActionFunc for saving pipeline configurations.

func PipelineTemplateConvertAction added in v0.2.0

func PipelineTemplateConvertAction(clientConfig spinnaker.ClientConfig) cli.ActionFunc

func PipelineTemplateDeleteAction added in v0.4.0

func PipelineTemplateDeleteAction(clientConfig spinnaker.ClientConfig) cli.ActionFunc

func PipelineTemplatePlanAction

func PipelineTemplatePlanAction(clientConfig spinnaker.ClientConfig) cli.ActionFunc

PipelineTemplatePlanAction creates the ActionFunc for planning a pipeline template with a given configuration.

func PipelineTemplatePublishAction

func PipelineTemplatePublishAction(clientConfig spinnaker.ClientConfig) cli.ActionFunc

PipelineTemplatePublishAction creates the ActionFunc for publishing pipeline templates.

Types

type InheritanceControlRule added in v0.4.2

type InheritanceControlRule struct {
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
}

type PipelineConfig added in v0.2.0

type PipelineConfig struct {
	Inherit              []string        `json:"inherit"`
	ConcurrentExecutions map[string]bool `json:"concurrentExecutions"`
	Triggers             []interface{}   `json:"triggers"`
	Parameters           []interface{}   `json:"parameters"`
	Notifications        []interface{}   `json:"notifications"`
	Description          string          `json:"description"`
}

type PipelineConfiguration added in v0.2.0

type PipelineConfiguration struct {
	Schema        string                          `json:"schema"`
	ID            string                          `json:"id"`
	Pipeline      PipelineConfigurationDefinition `json:"pipeline"`
	Configuration PipelineConfig                  `json:"configuration"`
	Stages        []PipelineTemplateStage         `json:"stages"`
	Modules       []PipelineTemplateModule        `json:"modules,omitempty"`
	Partials      []PipelineTemplatePartial       `json:"partials,omitempty"`
}

func (PipelineConfiguration) ToClient added in v0.2.0

type PipelineConfigurationDefinition added in v0.2.0

type PipelineConfigurationDefinition struct {
	Application      string                 `json:"application"`
	Name             string                 `json:"name"`
	Template         TemplateSource         `json:"template"`
	PipelineConfigID string                 `json:"pipelineConfigId"`
	Variables        map[string]interface{} `json:"variables"`
}

type PipelineTemplate added in v0.2.0

type PipelineTemplate struct {
	Schema        string                   `json:"schema"`
	ID            string                   `json:"id"`
	Metadata      PipelineTemplateMetadata `json:"metadata"`
	Protect       bool                     `json:"protect"`
	Configuration PipelineTemplateConfig   `json:"configuration,omitempty"`
	Variables     []interface{}            `json:"variables,omitempty"`
	Stages        []PipelineTemplateStage  `json:"stages"`
}

type PipelineTemplateConfig added in v0.2.0

type PipelineTemplateConfig struct {
	ConcurrentExecutions map[string]bool          `json:"concurrentExecutions,omitempty"`
	Triggers             []map[string]interface{} `json:"triggers,omitempty"`
	Parameters           []map[string]interface{} `json:"parameters,omitempty"`
	Notifications        []map[string]interface{} `json:"notifications,omitempty"`
}

type PipelineTemplateMetadata added in v0.2.0

type PipelineTemplateMetadata struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Owner       string   `json:"owner"`
	Scopes      []string `json:"scopes,omitempty"`
}

type PipelineTemplateModule added in v0.2.0

type PipelineTemplateModule struct {
	ID         string                   `json:"id"`
	Usage      string                   `json:"usage"`
	Variables  []map[string]interface{} `json:"variables,omitempty"`
	When       []string                 `json:"when,omitempty"`
	Definition map[string]interface{}   `json:"definition"`
}

type PipelineTemplatePartial added in v0.2.0

type PipelineTemplatePartial struct {
	ID        string                   `json:"id"`
	Usage     string                   `json:"usage"`
	Variables []map[string]interface{} `json:"variables,omitempty"`
	Stages    []PipelineTemplateStage  `json:"stages"`
}

type PipelineTemplateStage added in v0.2.0

type PipelineTemplateStage struct {
	ID                 string                                  `json:"id"`
	Type               string                                  `json:"type"`
	DependsOn          []string                                `json:"dependsOn,omitempty"`
	Inject             PipelineTemplateStageInjection          `json:"inject,omitempty"`
	Name               string                                  `json:"name"`
	Config             map[string]interface{}                  `json:"config"`
	Notifications      []map[string]interface{}                `json:"notifications,omitempty"`
	Comments           string                                  `json:"comments,omitempty"`
	When               []string                                `json:"when,omitempty"`
	InheritanceControl PipelineTemplateStageInheritanceControl `json:"inheritanceControl,omitempty"`
}

type PipelineTemplateStageInheritanceControl added in v0.4.2

type PipelineTemplateStageInheritanceControl struct {
	Merge   []InheritanceControlRule `json:"merge,omitempty"`
	Replace []InheritanceControlRule `json:"replace,omitempty"`
	Remove  []InheritanceControlRule `json:"remove,omitempty"`
}

type PipelineTemplateStageInjection added in v0.4.2

type PipelineTemplateStageInjection struct {
	First  bool     `json:"first,omitempty"`
	Last   bool     `json:"last,omitempty"`
	Before []string `json:"before,omitempty"`
	After  []string `json:"after,omitempty"`
}

type TemplateSource added in v0.2.0

type TemplateSource struct {
	Source string `json:"source"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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