git

package
v0.34.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

README

Version Control/Git Service

This service uses gopkg.in/src-d/go-git.v4 git client

Service Id Action Description Request Response
version/control status run version control check on provided URL StatusRequest Info
version/control checkout if target directory already exist with matching origin URL, this action only pulls the latest changes without overriding local ones, otherwise full checkout CheckoutRequest Info

Usage

Checkout/pull

  1. Basic checkout
    pipeline:
      checkout:
        action: vc/git:checkout
        origin:
          URL: https://github.com/src-d/go-git
        dest:
          URL: /tmp/foo
    
  2. Private repo with basic auth
    pipeline:
      checkout:
        action: vc/git:checkout
        origin:
          URL: https://github.com/myacount/myrepo.git
          credentials: myacount
        dest:
          URL: /tmp/myrepo
    
  3. Private key based auth
    • endly -c=myacountpk -k=/path/key_rsa where username is git and password is pharaprase
    • endly -r=checkout
    • @checkout.yaml
    pipeline:
      checkout:
        action: vc/git:checkout
        origin:
          URL: git@github.com/myacount/myrepo.git
          credentials: myrepopk
        dest:
          URL: /tmp/myrepo
    

Documentation

Index

Constants

View Source
const ServiceID = "vc/git"

Variables

This section is empty.

Functions

func New

func New() endly.Service

Types

type CheckoutRequest

type CheckoutRequest struct {
	Origin *url.Resource `required:"true" description:"checkout source for git or svn or simply file::/path"`
	Dest   *url.Resource `required:"true" description:"checkout dest defined by host and path URL"`
	Depth  int
}

CheckoutRequest represents checkout request. If target directory exist and contains matching origin URL, only taking the latest changes without overriding local if performed, otherwise full checkout

func (*CheckoutRequest) Init

func (r *CheckoutRequest) Init() error

Init initializes request

func (*CheckoutRequest) Validate

func (r *CheckoutRequest) Validate() error

Validate validates request

type CheckoutResponse

type CheckoutResponse StatusResponse

CheckoutResponse represents checkout response

type Info

type Info struct {
	IsVersionControlManaged bool   //returns true if directory is source controlled managed
	Origin                  string //Origin URL
	Revision                string //Origin Revision
	Branch                  string //current branch
	IsUptoDate              bool
	Added                   []string //new files
	Untracked               []string //untracked files
	Modified                []string //modified files
	Deleted                 []string //deleted files
}

Info represents version control info

func NewInfo

func NewInfo() *Info

NewInfo create new info

func (*Info) HasPendingChanges

func (r *Info) HasPendingChanges() bool

HasPendingChanges returns true if there are any untracked, new, modified, deleted files.

type OutputEvent

type OutputEvent struct {
	*msg.OutputEvent
}

OutputEvent represents an output event

type StatusRequest

type StatusRequest struct {
	Source *url.Resource `required:"true"`
}

StatusRequest represents version control status

func (*StatusRequest) Init

func (r *StatusRequest) Init() error

Init initializes request

func (*StatusRequest) Validate

func (r *StatusRequest) Validate() error

Validate validates request

type StatusResponse

type StatusResponse struct {
	*Info
}

StatusResponse represents version control status response

Jump to

Keyboard shortcuts

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