Back to godoc.org

Package bitriseapi

v0.0.0-...-4c20bd0
Latest Go to latest

The latest major version is .

Published: Aug 4, 2020 | License: MIT | Module: github.com/bitrise-io/bitrise-webhooks

Index

func BuildTriggerURL

func BuildTriggerURL(apiRootURL string, appSlug string) (*url.URL, error)

BuildTriggerURL ...

type BuildParamsModel

type BuildParamsModel struct {
	// git commit hash
	CommitHash string `json:"commit_hash,omitempty"`
	// git commit message
	CommitMessage string `json:"commit_message,omitempty"`
	// source branch
	Branch string `json:"branch,omitempty"`
	// source branch repo owner
	BranchRepoOwner string `json:"branch_repo_owner,omitempty"`
	// destination branch, exposed for pull requests
	BranchDest string `json:"branch_dest,omitempty"`
	// destination branch repo owner, exposed for pull requests
	BranchDestRepoOwner string `json:"branch_dest_repo_owner,omitempty"`
	// tag
	Tag string `json:"tag,omitempty"`
	// pull request id, exposed for pull requests from the provider's serivce
	PullRequestID *int `json:"pull_request_id,omitempty"`
	// repository url that holds the source for the pull request
	PullRequestRepositoryURL string `json:"pull_request_repository_url,omitempty"`
	// pre-merged branch if the provider supports it, exposed for pull requests
	PullRequestMergeBranch string `json:"pull_request_merge_branch,omitempty"`
	// source branch mapped to the original repository if the provider supports it, exposed for pull requests
	PullRequestHeadBranch string `json:"pull_request_head_branch,omitempty"`
	// The creator of the pull request
	PullRequestAuthor string `json:"pull_request_author,omitempty"`
	// workflow id to run
	WorkflowID string `json:"workflow_id,omitempty"`
	// additional environment variables
	Environments []EnvironmentItem `json:"environments,omitempty"`
	// URL of the diff
	DiffURL string `json:"diff_url"`
	// paths of changes
	PushCommitPaths []CommitPaths `json:"commit_paths"`
}

BuildParamsModel ...

type CommitPaths

type CommitPaths struct {
	Added    []string `json:"added"`
	Removed  []string `json:"removed"`
	Modified []string `json:"modified"`
}

CommitPaths ...

type EnvironmentItem

type EnvironmentItem struct {
	Name     string `json:"mapped_to"`
	Value    string `json:"value"`
	IsExpand bool   `json:"is_expand"`
}

EnvironmentItem ...

type TriggerAPIParamsModel

type TriggerAPIParamsModel struct {
	BuildParams BuildParamsModel `json:"build_params"`
	TriggeredBy string           `json:"triggered_by"`
}

TriggerAPIParamsModel ...

func (TriggerAPIParamsModel) Validate

func (triggerParams TriggerAPIParamsModel) Validate() error

Validate ...

type TriggerAPIResponseModel

type TriggerAPIResponseModel struct {
	Status            string `json:"status"`
	Message           string `json:"message"`
	Service           string `json:"service"`
	AppSlug           string `json:"slug"`
	BuildSlug         string `json:"build_slug"`
	BuildNumber       int    `json:"build_number"`
	BuildURL          string `json:"build_url"`
	TriggeredWorkflow string `json:"triggered_workflow"`
}

TriggerAPIResponseModel ...

func TriggerBuild

func TriggerBuild(url *url.URL, apiToken string, params TriggerAPIParamsModel, isOnlyLog bool) (TriggerAPIResponseModel, bool, error)

TriggerBuild ... Returns an error in case it can't send the request, or the response is

not a HTTP success response.

If the response is an HTTP success response then the whole response body

will be returned, and error will be nil.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier