Version: v0.0.0-...-7e68fd7 Latest Latest

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 12 Imported by: 0




This section is empty.


This section is empty.


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"`
	// Deprecated: Use HeadRepositoryURL instead
	PullRequestRepositoryURL string `json:"pull_request_repository_url,omitempty"`
	// URL of the base repository
	BaseRepositoryURL string `json:"base_repository_url,omitempty"`
	// URL of the head repository
	HeadRepositoryURL string `json:"head_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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL