freight

package module
v0.0.0-...-5623668 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

README

Freight

Freight is a tool for downloading and scripting the bootstrapping of large multi-repo projects. it can download git repos, as well as any other assets as well as execute basic tasks relating to those resources.

Example

freight {
  root = "~/go/src/github.com/ChrisMcKenzie/freight/test/"
}

project "dropship" {
  path = "tools"
  remote = "github.com/ChrisMckenzie/dropship"

  after "script" {
    command = <<CODE
      go install -v
    CODE
  }

  after "script" {
    command = <<CODE
      echo "what's up!"
    CODE
  }
}

project "accord" {
  path = "tools"
  remote = "github.com/ChrisMckenzie/accord"
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProgressBarConfig

func ProgressBarConfig(bar *pb.ProgressBar, prefix string)

Types

type BaseConfig

type BaseConfig struct {
	Root string `mapstructure:"root", hcl:"root"`
}

BaseConfig defines the top level or "root" config options available in a freight config file

type Config

type Config struct {
	Base     BaseConfig `mapstructure:"freight", hcl:"freight,squash"`
	Projects []*Project `mapstructure:"project" hcl:"project"`
}

type Manager

type Manager struct{}

Manager manages the resolving projects and tasks in a freight manafest

func (*Manager) Run

func (m *Manager) Run(ctx context.Context, cfg *Config) error

type ProgressBar

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

ProgressBar wraps a github.com/cheggaaa/pb.Pool in order to display download progress for one or multiple downloads.

If two different instance of ProgressBar try to display a progress only one will be displayed. It is therefore recommended to use DefaultProgressBar

func (*ProgressBar) TrackProgress

func (cpb *ProgressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser

TrackProgress instantiates a new progress bar that will display the progress of stream until closed. total can be 0.

type Project

type Project struct {
	Name   string
	Remote string
	Path   string

	AfterTasks []tasks.Task
}

func (*Project) Resolve

func (p *Project) Resolve(ctx context.Context, bc BaseConfig) error

type State

type State struct {
	CWD string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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