bootstrapCmd

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2015 License: MIT Imports: 20 Imported by: 0

README

repo bootstrap

Generate initial local SalsaFlow configuration.

Usage

salsaflow repo bootstrap -issue_tracker=ISSUE_TRACKER
                         -code_review_tool=CODE_REVIEW_TOOL
                         [-skeleton=SKELETON]

Description

repo bootstrap can be used to generate initial local SalsaFlow configuration so that the repository can be set up quickly.

The issue_tracker and code_review_tool flags must be supplied to tell SalsaFlow what modules you are going to use for the project. It affects the local configuration file template that is generated.

The skeleton flag can be used to quickly set up the remaining configuration for SalsaFlow, most importantly the custom scripts. When supplied with OWNER/REPO, SalsaFlow will get the GitHub repository specified by that value and it will copy the content into the local metadata directory. This can be easily used to share custom scripts by making a skeleton for every distinct project type.

Steps

This command goes through the following steps:

  1. Take the flags and write a configuration file template into .salsaflow/config.yml. This template needs to be filled in, but the keys to be filled are clearly visible.
  2. We are done in case skeleton is not specified.
  3. Clone the given skeleton repository into the local cache, which is located in the current user's home directory. The repository is just pulled in case it already exists. Once the content is available, it is copied into the local metadata directory, .salsaflow.

Documentation

Overview

Generate initial local SalsaFlow configuration.

salsaflow repo bootstrap -issue_tracker=ISSUE_TRACKER
                         -code_review_tool=CODE_REVIEW_TOOL
                         [-skeleton=SKELETON]

Description

This command can be used to generate initial local SalsaFlow configuration so that the repository can be set up quickly.

The -issue_tracker and -code_review_tool flags must be supplied to tell SalsaFlow what modules you are going to use for the project. It affects the local configuration file template that is generated.

The -skeleton flag can be used to quickly set up the remaining configuration for SalsaFlow, most importantly the custom scripts. When supplied with OWNER/REPO, SalsaFlow will get the GitHub repository specified by that value and it will copy the content into the local metadata directory. This can be easily used to share custom scripts by making a skeleton for every distinct project type.

Steps

This command goes through the following steps:

  1. Take the flags and write a configuration file template into .salsaflow/config.yml. This template needs to be filled in, but the keys to be filled are clearly visible.
  2. We are done in case -skeleton is not specified.
  3. Clone the given skeleton repository into the local cache, which is located in the current user's home directory. The repository is just pulled in case it already exists. Once the content is available, it is copied into the local metadata directory, .salsaflow.

Index

Constants

View Source
const LocalConfigTemplate = `` /* 810-byte string literal not displayed */
View Source
const SkeletonCacheDirname = ".salsaflow_skeletons"

Variables

View Source
var Command = &gocli.Command{
	UsageLine: `
  bootstrap -issue_tracker=ISSUE_TRACKER
            -code_review_tool=CODE_REVIEW_TOOL
            [-release_notes=RELEASE_NOTES]
            [-skeleton=SKELETON]`,
	Short: "generate local config for SalsaFlow",
	Long: `
  This command can be used to set up the repository to work with SalsaFlow.

  SalsaFlow needs certain information to be kept in the repository
  to be able to function properly. To make the initial repository setup
  easier, repo bootstrap can be used to generate all necessary files,
  which can be then modified manually if necessary.

  The files are just dumped into the working tree, into .salsaflow directory.
  The directory must be committed after making sure everything is correct.

  Considering the flags, 'issue_tracker', 'code_review_tool' and
  'release_notes' can be used to tell SalsaFlow what implementation to use
  for particular service modules. The first two flags are required, the last one
  is optional. See the AVAILABLE MODULES section for the allowed values.

  The 'skeleton' flag is a bit different. It can be used to specify
  a GitHub repository that is used as the skeleton for project custom scripts.
  The repository is simply cloned and the contents are poured into .salsaflow.
  The format is '<org>/<repo>', e.g. 'salsaflow/skeleton-golang'.
	`,
	Action: run,
}

Functions

func WriteLocalConfigTemplate

func WriteLocalConfigTemplate(dst io.Writer, ctx *LocalContext) error

Types

type LocalContext

type LocalContext struct {
	EnabledTimestamp                  Time
	IssueTrackerKey                   string
	IssueTrackerConfigTemplate        string
	CodeReviewToolKey                 string
	CodeReviewToolConfigTemplate      string
	ReleaseNotesManagerKey            string
	ReleaseNotesManagerConfigTemplate string
}

type Time added in v0.6.0

type Time time.Time

The whole point of this type is to wrap time.Time to make it work with go-yaml out of the box. go-yaml uses Time.String method to marshal time.Time while using Time.UnmarshalText for unmarshalling, which is unfortunately not symmetrical.

func (Time) String added in v0.6.0

func (t Time) String() string

Jump to

Keyboard shortcuts

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