Commit Graph

159 Commits

Author SHA1 Message Date
Luke Kysow
8aca81966f Add Apache 2 license and copyright.
Add Apache 2 license and Hootsuite copyright to all golang
files. Add a disclaimer that the files have been modified
hereafter by contributors to this repo in order to abide
by the Apache 2 license requirements.
2018-03-15 17:25:02 -07:00
Luke Kysow
b7e58e2378 Split GitHub comments into multiple if over max.
Fixes #55. GitHub will throw an error if the comment is over
65535 characters. Now we will split up a comment into multiple
comments if it's over that size.
2018-03-14 15:28:22 -07:00
Luke Kysow
359dd43f27 Put Atlantis version in footer. 2018-03-14 10:16:48 -07:00
Luke Kysow
a0f05f7001 Use const for version. Fix tests, format. 2018-03-14 10:04:09 -07:00
Luke Kysow
1b00e5a0bb Update web_templates.go 2018-03-14 09:57:21 -07:00
Paul Salaberria
1154a09536 Rename config structs
- Config to UserConfig
- FlagNames to Config
- Use AtlantisVersion to be clear
2018-03-11 23:38:33 +01:00
Paul Salaberria
d8f5ff71f3 Show atlantis version in index page 2018-03-11 23:12:37 +01:00
Luke Kysow
d9595867cd Fix gometalint errors. 2018-03-11 14:19:16 -07:00
Luke Kysow
32e0b4003e Small refactor to events_controller. Final tests. 2018-03-11 13:30:01 -07:00
Luke Kysow
0e6bae7226 Output usage on error. 2018-03-11 12:51:11 -07:00
Luke Kysow
394cd52c6d Fix bug with whitelisting. 2018-03-08 23:40:55 -08:00
Luke Kysow
8ee9333e0d Use repo whitelist on atlantis bootstrap.
Fix e2e tests.
2018-03-08 23:14:21 -08:00
Luke Kysow
f91947a397 Comment with error when unused arguments. 2018-03-08 23:10:02 -08:00
Luke Kysow
c9a9c2deb3 Update README. Fix gometalint errors. 2018-03-08 22:40:00 -08:00
Luke Kysow
31dc84853a [Draft] Add --repo-whitelist option.
- this option is now required which breaks BC
- will validate that an event is coming from a repo that we trust
- started refactoring event_controller tests to use less mocks
2018-03-08 17:49:47 -08:00
Luke Kysow
f5658a707c Implement repo whitelist. 2018-03-08 17:42:29 -08:00
Luke Kysow
5e5bc60bdc Rename pointer receiver 2018-03-08 11:51:27 -08:00
Luke Kysow
e8ad2202c7 Add hostname to Repo model.
- Ended up changing how we parse the json so we do the validation in the
constructor of the Repo so it's the same everywhere.
- This is a preliminary commit to finish the repo whitelisting feature
2018-03-08 11:48:11 -08:00
Luke Kysow
35d3e14124 Add --allow-fork-prs option. Default to false.
Operating on forked pull requests is dangerous if it's a public repo
because anyone can make a pull request to a public repo. We default to
false like CircleCI and TravisCI who don't allow credentials to be
available on fork PRs.
2018-03-06 20:09:55 -08:00
Luke Kysow
e6cdf15f07 Fix bug where apply -d was using parent dir.
- Fixes #22. We were running apply in the parent directory.
- Also changes error message if no plans are found to apply.
2018-03-06 08:50:28 -08:00
Luke Kysow
a24d940f5d Rename DetermineCommand to Parse 2018-02-28 11:04:28 -08:00
Luke Kysow
2af2f10cbc Ensure quotes are escaped for extra args. 2018-02-28 10:52:53 -08:00
Luke Kysow
a09ad79405 Refactor comment parsing into own class. 2018-02-28 10:42:21 -08:00
Luke Kysow
ab1d36d2c8 Comment back on pull request sooner on error.
- Refactor EventParser so it returns a comment we can send to the pull
request when a bad command or help command is commented.
- Remove now unneeded HelpExecutor because we comment right from the
EventsController now
- Use pflag package to parse commands instead of doing it manually
- Comment back when user types terraform instead of atlantis
2018-02-27 17:45:05 -08:00
Luke Kysow
9586c87246 Use pullNum instead of pull model in CreateComment
This will enable us to use the CreateComment function
without having the full pull request model.
2018-02-27 14:49:26 -08:00
Luke Kysow
75e90c1917 Quote extra comment args.
To avoid an attacker prepending something like
atlantis plan -- ; cat /etc/passwd
2018-02-27 12:55:26 -08:00
Luke Kysow
0fd503da8a Update README for new flags. 2018-02-26 15:10:04 -08:00
Luke Kysow
6dd82c6de1 Validate directory flag. Unlock on preexecute err.
Ensure -d flag uses relative dirs and doesn't allow for
directory traversal.

Fix bug where if there was an error in PreExecute, we
wouldn't unlock, leaving a possibly abandoned lock.
2018-02-26 14:32:06 -08:00
Luke Kysow
0d1f50a7a8 Implement parsing for -w and -d flags. 2018-02-22 17:31:24 -08:00
Luke Kysow
6b0eece5c9 Fix bug with top-level modules/ directory.
Fixes #12. Previously we would assume that if there was a change
in any modules/ directory, we should run plan in the parent. Now
we first check whether the parent has a main.tf file. If it doesn't
then we assume it's not actually the root of a project.
2018-02-20 12:54:10 -08:00
Luke Kysow
6c159feff4 Rename to runatlantis from atlantisnorth. 2018-02-18 21:28:18 -08:00
Luke Kysow
0299d3ee12 Move to new atlantisnorth repo 2018-02-06 13:29:36 -08:00
Luke Kysow
c54dd589c6 Native SSL Support (#233)
Add two new flags ssl-key-file and ssl-cert-file to enable Atlantis to serve over SSL natively instead of going through an NGINX proxy.

This is a squashed commit containing the primary work by @natemueller
2018-01-23 11:32:22 -08:00
Luke Kysow
dd766b8ca8 Use 'SetBaseURL' to correctly set GitLab URL (#231)
This change updates server/server.go to set the GitLab URL using
the `Client.SetBaseURL` to set the base URL off of the configured
param. Previously even if a user set the `--gitlab-hostname` the
default URL for GitLab would not overriden to match this.
Work done by @jrasell

Closes #227
2018-01-15 21:53:51 -08:00
Luke Kysow
002980e423 Use env instead of workspace in 0.9 2017-12-21 16:34:49 -08:00
Luke Kysow
f72b674bd8 Rename Workspace to AtlantisWorkspace to avoid confusion 2017-12-17 17:16:04 -08:00
Luke Kysow
7c1220a655 Rename from environment to workspace 2017-12-17 16:46:49 -08:00
Luke Kysow
741295067a Use workspace instead of env for tf >=0.10 2017-12-17 15:40:39 -08:00
Luke Kysow
0109bcfcac Merge pull request #215 from hootsuite/safe-shutdown
Shut down server safely on SIGINT/TERM. Fixes #21
2017-12-17 14:45:20 -08:00
Luke Kysow
465dab1f23 Fix shadowed vars 2017-12-03 23:34:53 -08:00
Luke Kysow
76e0de91f8 Shut down server safely on SIGINT/TERM. Fixes #21 2017-12-03 22:07:53 -08:00
Luke Kysow
07b7293f3c Support changes in modules/ directories 2017-11-30 20:15:12 -08:00
Luke Kysow
e5b06454ba Fix gas linter errors. Disable err checking since that's handled by errcheck 2017-11-27 21:04:14 -08:00
Luke Kysow
cc924899e5 Add documentation for server, bootstrap and server/events packages 2017-11-26 21:41:06 -08:00
Luke Kysow
76b78c9316 Don't set as-user since not needed for workspace slack apps (#206) 2017-11-22 15:39:39 -08:00
Luke Kysow
acdf771ce7 Switch to newest pegomock library (#205) 2017-11-19 22:41:43 -08:00
Luke Kysow
9dc9434db2 Slack integration (#199)
Thanks to @nicholas-wu-hs !
2017-11-16 20:13:06 -08:00
Luke Kysow
fa43febf60 Gitlab (#190)
Gitlab initial implementation
2017-11-16 13:22:28 -08:00
Luke Kysow
62308e98a3 Test modules filtering bug that was fixed in #193 2017-11-16 12:55:37 -08:00
Patrick Otto
9c03615ccc find project paths based on filtered modified files 2017-11-14 17:46:03 +01:00