gitlab_ci_helper

package module
v0.0.0-...-9063a3c Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2018 License: MIT Imports: 20 Imported by: 3

README

gitlab-ci-helper

Build Status Coverage Status GoDoc GitHub license Go Report Card GitHub issues

This tool provides a binary cli to execute common commands inside a gitlab's job.

Installation

gitlab-ci-helper is a single binary with no external dependencies, released for several platforms. Go to the releases page, download the package for your OS, and copy the binary to somewhere on your PATH. Please make sure to rename the binary to gitlab-ci-helper and make it executable.

As it primarily targets GitLab CI environment, a simple curl will also do :).

A release also includes checksums for various build flavors, as a build has access to sensible information (GitLab tokens, AWS credentials…), please use them.

Commands

A detailed commands list is available in the commands.md file

Build Commands

  • ci:revision: dump a REVISION file
  • ci:meta: dump a ci.json file, with build information
  • project:builds:artifacts: download an artifacts file from a previous job

Integration Commands

  • hipchat:message: send a message to hipchat
  • flowdock:message: send a message to flowdock
  • flowdock:status: create a build status on flowdock

Tools commands

  • project:builds: list builds
  • project:list: list projets

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SemVersion = regexp.MustCompile("(v|)[0-9]{1,}\\.[0-9]{1,}\\.[0-9]{1,}(-[A-Za-z]*|)")

Functions

func GetAwsCredentials

func GetAwsCredentials(profile string) (*credentials.Credentials, error)

func GetBuild

func GetBuild(project *gitlab.Project, buildId string, client *gitlab.Gitlab) (*gitlab.Build, error)

func GetEnv

func GetEnv(name, deflt string) string

func GetProject

func GetProject(p string, client *gitlab.Gitlab) (*gitlab.Project, error)

func Unzip

func Unzip(archive, target string) error

func WrapperTestCommand

func WrapperTestCommand(reqs []*FakeRequest, envs map[string]string, t *testing.T, fn func(ts *httptest.Server))

func Zip

func Zip(includePaths, excludePaths Paths, target string) error

Types

type Config

type Config struct {
	Gitlab *GitLabConfig `json:"gitlab"`
}

func NewConfig

func NewConfig() *Config

type FakeRequest

type FakeRequest struct {
	Host   string
	Path   string
	Method string
	Called int

	Response *http.Response
}

type GitLabConfig

type GitLabConfig struct {
	Host    string `json:"host"`
	Token   string `json:"token"`
	ApiPath string `json:"api_path"`
}

type MailerConfig

type MailerConfig struct {
	SubjectPrefix string   `json:"subject"`
	Sender        string   `json:"sender"`
	Dest          []string `json:"dest"`
	Host          string   `json:"host"`
	Username      string   `json:"username"`
	Password      string   `json:"password"`
}

type Paths

type Paths []string

func (*Paths) Set

func (p *Paths) Set(value string) error

func (*Paths) String

func (p *Paths) String() string

Directories

Path Synopsis
integrations

Jump to

Keyboard shortcuts

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