resource

package module
v0.0.0-...-9328efa Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

README

Tracker Git Branch Resource

An input-only resource that links Pivotal Tracker stories to git feature branches.

  • On check, the resource will find finished and delivered Tracker stories and return the latest refs from the git branch corresponding to the Tracker story.
  • On input, the resource will clone the repository and checkout the appropriate ref.

The git branches are identified by the presence of a story ID in the branch name.

Configuration

Resource
- name: tracker
  type: tracker-git-branch
  source:
    token: TRACKER_API_TOKEN
    projects:
      - "TRACKER_PROJECT_ID"
    tracker_url: https://www.pivotaltracker.com
    repo: git@github.com:you/your_repo
    private_key: GITHUB_PRIVATE_KEY
Source Configuration
  • token: Required. Your API token, which can be found on your profile page.
  • projects: Required. Your Tracker project IDs, which can be found in the URL of your project. Make sure that each value is a string because it will converted to JSON when given to the resource and JSON doesn't like integers.
  • tracker_url: Optional.
  • repo: Required. The location of the repository which will contain the branches corresponding to Tracker stories.
  • private_key: Optional. Private key to use when pulling/pushing. Example:
    private_key: |
      -----BEGIN RSA PRIVATE KEY-----
      MIIEowIBAAKCAQEAtCS10/f7W7lkQaSgD/mVeaSOvSF9ql4hf/zfMwfVGgHWjj+W
      <Lots more text>
      DWiJL+OFeg9kawcUL6hQ8JeXPhlImG6RTUffma9+iGQyyBMCGd1l
      -----END RSA PRIVATE KEY-----
    

You'll need a seperate resource for each Tracker project.

Development

Run scripts/test to execute the tests using Ginkgo. The branches in this project are fixtures for the tests, so your working directory must not contain any uncommitted changes before running this script.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKeyFile

func CreateKeyFile(privateKey string) (string, error)

Types

type MetadataPair

type MetadataPair struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Repository

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

func NewRepository

func NewRepository(source string, dir string, keyFile string) Repository

func (Repository) CheckoutRef

func (r Repository) CheckoutRef(ref string) error

func (Repository) Clone

func (r Repository) Clone() error

func (Repository) Fetch

func (r Repository) Fetch() error

func (Repository) LatestRef

func (r Repository) LatestRef(branch string) (string, error)

func (Repository) RefAuthorDate

func (r Repository) RefAuthorDate(ref string) (string, error)

func (Repository) RefAuthorName

func (r Repository) RefAuthorName(ref string) (string, error)

func (Repository) RefCommitDate

func (r Repository) RefCommitDate(ref string) (string, error)

func (Repository) RefCommitName

func (r Repository) RefCommitName(ref string) (string, error)

func (Repository) RefCommitTimestamp

func (r Repository) RefCommitTimestamp(ref string) (int64, error)

func (Repository) RefMessage

func (r Repository) RefMessage(ref string) (string, error)

func (Repository) RefsSinceTimestamp

func (r Repository) RefsSinceTimestamp(branch string, timestamp int64) ([]string, error)

func (Repository) RemoteBranches

func (r Repository) RemoteBranches() ([]string, error)

type Source

type Source struct {
	Token      string   `json:"token"`
	Projects   []string `json:"projects"`
	TrackerURL string   `json:"tracker_url"`
	Repo       string   `json:"repo"`
	PrivateKey string   `json:"private_key"`
}

type Version

type Version struct {
	StoryID   string `json:"story_id"`
	Ref       string `json:"ref"`
	Timestamp string `json:"timestamp"`
}

Directories

Path Synopsis
Godeps
_workspace/src/github.com/onsi/ginkgo
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
_workspace/src/github.com/onsi/ginkgo/config
Ginkgo accepts a number of configuration options.
Ginkgo accepts a number of configuration options.
_workspace/src/github.com/onsi/ginkgo/ginkgo
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
_workspace/src/github.com/onsi/ginkgo/internal/remote
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
_workspace/src/github.com/onsi/ginkgo/reporters
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
_workspace/src/github.com/onsi/gomega
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
_workspace/src/github.com/onsi/gomega/format
Gomega's format package pretty-prints objects.
Gomega's format package pretty-prints objects.
_workspace/src/github.com/onsi/gomega/gbytes
Package gbytes provides a buffer that supports incrementally detecting input.
Package gbytes provides a buffer that supports incrementally detecting input.
_workspace/src/github.com/onsi/gomega/gexec
Package gexec provides support for testing external processes.
Package gexec provides support for testing external processes.
_workspace/src/github.com/onsi/gomega/ghttp
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
_workspace/src/github.com/onsi/gomega/matchers
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
in
out

Jump to

Keyboard shortcuts

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