Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to use this tool on local machine? #4

Open
uohzxela opened this issue Apr 16, 2018 · 1 comment
Open

Possible to use this tool on local machine? #4

uohzxela opened this issue Apr 16, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@uohzxela
Copy link

Hey there, nice project. From the looks of it, this tool is supposed to run on CI server. Just asking if it's possible to use this tool on local machine when running terraform plan/apply? Thanks!

@uohzxela uohzxela changed the title Possible to use this tool locally? Possible to use this tool on local machine? Apr 16, 2018
@babarot
Copy link
Contributor

babarot commented Apr 23, 2018

If you specify Slack as its notificator, you can run this from your machine.

---
ci: circleci
notifier:
  slack:
    token: $SLACK_TOKEN
$ terraform plan | tfnotify plan

However, as you said, tfnotify cannot be run in local machine if GitHub is selected as notificator. Because tfnotify cannot know the GitHub P-R number if it ran in local machine.

For now, tfnotify can know that number if it ran in CI machine, thanks to this feature:

tfnotify/ci.go

Lines 44 to 48 in ecebe34

func travisci() (ci CI, err error) {
ci.PR.Revision = os.Getenv("TRAVIS_PULL_REQUEST_SHA")
ci.PR.Number, err = strconv.Atoi(os.Getenv("TRAVIS_PULL_REQUEST"))
return ci, err
}

Do you need to run this in your local machine?

@babarot babarot added the enhancement New feature or request label Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants