Files
atlantis/help_executor.go
Luke Kysow 0cb13a9e85 Fixes #10. Renaming for consistency (#12)
Repo owner, name => repoFullName
PullID => PullNum to match GitHub API
PR => Pull to match GitHub API and avoid writing PRID anywhere
2017-05-31 16:46:49 -07:00

48 lines
1.2 KiB
Go

package main
type HelpExecutor struct {
BaseExecutor
}
var helpComment = "```cmake\n" +
`atlantis - Terraform collaboration tool that enables you to collaborate on infrastructure
safely and securely. (v` + version + `)
Usage: atlantis <command> [environment] [--verbose]
Commands:
plan Runs 'terraform plan' on the files changed in the pull request
apply Runs 'terraform apply' using the plans generated by 'atlantis plan'
help Get help
Examples:
# Generates a plan for staging environment
atlantis plan staging
# Generates a plan for a standalone terraform project
atlantis plan
# Applies a plan for staging environment
atlantis apply staging
# Applies a plan for a standalone terraform project
atlantis apply
`
func (h *HelpExecutor) execute(ctx *ExecutionContext, github *GithubClient) {
pullCtx := &PullRequestContext{
repoFullName: ctx.repoFullName,
head: ctx.head,
base: ctx.base,
number: ctx.pullNum,
pullRequestLink: ctx.pullLink,
terraformApplier: ctx.requesterUsername,
terraformApplierEmail: ctx.requesterEmail,
}
github.CreateComment(pullCtx, helpComment)
ctx.log.Info("generating help comment....")
return
}