Commit Graph

50 Commits

Author SHA1 Message Date
Luke Kysow
74d4cc6cef Add newlines between flags in help output.
- This will make the help output easier to read. To accomplish this, we
needed to not set defaults via cobra because then the default would be
printed on another line which looks bad. So now we set the defaults
ourselves.
- Also had to update spf13/pflag to the version that supports newlines
in flag descriptions.
2018-03-28 12:19:48 -07:00
Luke Kysow
c8f68e2297 Refactor env var work and add tests.
- added tests
- moved AutomaticEnv() call into the init() function of the server flag
so it's set when we run the tests. Before it was in main().
- Set SetTypeByDefaultValue to true so boolean flags can be specified as
env vars.
2018-03-20 12:13:45 -07:00
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
a0f05f7001 Use const for version. Fix tests, format. 2018-03-14 10:04:09 -07:00
Luke Kysow
d9ff7cff7b Don't rename some comments 2018-03-12 09:40:46 -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
Luke Kysow
0e6bae7226 Output usage on error. 2018-03-11 12:51:11 -07: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
b45ee9c86c Set max column width for help output.
Also add > to flag description so easier to differentiate between a new
flag description.
2018-03-07 13:36:24 -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
4941456cb1 Warn on unset webhook secrets. Document security. 2018-03-06 17:31:51 -08:00
Luke Kysow
486d3615de Merge pull request #10 from runatlantis/data-dir
Convert relative --data-dir paths to absolute.
2018-02-18 21:34:51 -08:00
Luke Kysow
6c159feff4 Rename to runatlantis from atlantisnorth. 2018-02-18 21:28:18 -08:00
Luke Kysow
e2a02fd991 Convert relative --data-dir paths to absolute.
Fixes https://github.com/hootsuite/atlantis/issues/245
2018-02-16 10:06:46 -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
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
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
73d04fb89a Add gometalint. Fix errors (#176) 2017-10-31 20:07:41 -07:00
Luke Kysow
3d361ebd59 Code review fixups 2017-10-28 20:04:15 -07:00
Luke Kysow
fe773fe757 Test cmd/server 2017-10-28 18:06:10 -07:00
Luke Kysow
00642aad14 Enable silencing output to keep tests clean 2017-10-28 10:06:12 -07:00
Luke Kysow
03317b9aa4 Refactoring to enable easier command testing 2017-10-28 09:30:06 -07:00
Luke Kysow
5b4a52446b Initial refactor to allow for testing cmds 2017-10-26 07:15:56 -07:00
Luke Kysow
6dc9de175d Remove assume role functionality. Rely on Terraform. Fixes #112 2017-08-15 09:58:41 -07:00
Luke Kysow
ff0f32ca01 Add ability toverify webhook secret. Fixes #34 2017-08-13 22:28:38 -07:00
Luke Kysow
83ac2f72b2 Uppercase URL 2017-08-02 13:40:14 -07:00
Luke Kysow
433f8875c3 Make bootstrap re-runnable. README edits 2017-08-01 22:37:20 -07:00
Luke Kysow
ccdfeae8c1 Default require-approval to false (#88) 2017-07-31 00:15:35 -07:00
Luke Kysow
e728d2548b Add Getting Started instructions. Rename gh-password to gh-token 2017-07-27 13:51:48 -07:00
Luke Kysow
6ce0bba798 Pass in session to be assumed each time 2017-07-18 09:07:21 -07:00
Luke Kysow
3748e4983b Show errors on invalid flags 2017-07-18 09:06:43 -07:00
Luke Kysow
99a0f0c4df Delete dynamodb locking code since Atlantis only works with disk right now 2017-07-12 09:46:45 -07:00
Luke Kysow
23d6b0cbd6 Write docs for packages 2017-07-09 18:18:36 -07:00
Luke Kysow
7747bc54ed Allow atlantis to be called by the name of the api user 2017-07-08 13:34:23 -07:00
Anubhav Mishra
fc275c1e52 Update server.go 2017-07-02 17:02:30 -07:00
Luke Kysow
3187477a44 Change endpoint from /hooks to /events. Fixes #22 2017-07-02 14:19:35 -07:00
Luke Kysow
5ea4ccd1b2 Remove sshKey hack. Use go-homedir (#63)
* Remove sshKey hack. Use go-homedir

* Add go-homedir lib
2017-07-01 18:03:51 -07:00
Luke Kysow
6dfe20757e Only store plans locally. Keep them in workspace (#60)
* Only store plans locally. Keep them in workspace
2017-07-01 16:50:38 -07:00
Luke Kysow
8fbe662185 Return error if workspace doesn't exist (#61)
* Return error if workspace doesn't exist
* Default data dir to ~/.atlantis. Don't clean workspaces
* Run goimports
2017-07-01 16:17:22 -07:00
Anubhav Mishra
9ff948cb55 Project config (#56)
* first incomplete draft for project config and pre run refactor

* adding prerun and terraform 0.9 and above support

* partial review

* Changes from pull review. Fix approvals

* more clean up and refactor of terraform init and environment commands to support terraform 0.9.0 and above

* making apply similar to plan for appending extra arguments

* review

* missed apply executor changes and fixing tests
2017-07-01 14:51:50 -07:00
Luke Kysow
d50d897274 Refactor status (#41)
* Refactor status into its own struct
* Run gofmt
2017-06-21 09:47:36 -07:00
Luke Kysow
906033e99e Implement local plan storage. Refactor S3 storage (#33)
* added new flags `plan-backend`, `plan-s3-bucket`, `plan-s3-prefix` and deleted `s3-bucket`
* interface `plan.Backend` that is implemented by `file` and `s3`
* simplified s3 code
* didn't end up following my suggestions in #30 since storing stuff in metadata requires you to `Get` the object *first* and then use the metadata. By parsing the `Key` to get repo, pull, path, and env, it skips an initial `Get` step, and I can download directly to the correct directory
* allow users to specify `application/json` or `application/x-www-form-urlencoded` for the webhook delivery type
* remove sending of special header for pull request api (fixes #11)

Closes #30 and #17 and #11
2017-06-20 00:22:42 -07:00
Luke Kysow
a837298f5e Alphabetize flags 2017-06-17 15:05:12 -07:00
Luke Kysow
d425de95fa Refactoring
* set version in one place
* rename ExecutionContext to CommandContext
* delete unneeded PullRequestContext since it just duplicated what is in CommandContext
* split fields inside CommandContext into Repo, PullRequest, and User models
* clean up unused fields
* remove base_executor stuff which was trying to do inheritance in go and didn't get us anywhere
* clean up unused code and assets
* created a locking.Client that creates the Keys that are used on the front-end. This allows the backends to store the locks any way they like as long as they support the interface
2017-06-17 14:14:21 -07:00
Luke Kysow
57f188f95f Unlock locks when pull request merged (#19)
* Add new FindLocksForPull method to locking backends
* Listen for pull request closed events and delete locks
* DynamoDB handling its own serialization. Implement LocksByPull
* Fix routing to work with encoded lockID
* Move locking backends to individual packages
* Change flag from locking-table to locking-dynamodb-table
2017-06-13 22:48:34 -07:00
Anubhav Mishra
dfe31f44b1 fixing default github api url 2017-06-10 19:25:33 -07:00
Luke Kysow
d1bda5ff28 Use cobra and viper for cli/config (#20)
* #15 Use cobra and viper for cli/config

* Run gofmt
2017-06-07 21:20:37 -07:00