Commit Graph

191 Commits

Author SHA1 Message Date
Luke Kysow
b5e2a730de WIP Add operators and get compiled. 2018-06-15 14:03:27 +01:00
Luke Kysow
d70e57e87b Yaml parsing and validation. 2018-06-13 13:54:04 +01:00
Luke Kysow
f59fe33a4c Parse YAML without defaults/validation. 2018-06-12 18:43:22 +01:00
Luke Kysow
3525ab3bd9 WIP 2018-06-12 14:54:38 +01:00
Luke Kysow
9839e0dac1 Move execution planner. Don't plan in deleted dirs 2018-06-11 18:00:57 +01:00
Luke Kysow
437b62591a Test execution_planner 2018-06-08 20:58:29 +01:00
Luke Kysow
d6883e83e4 Move runtime elements to the runtime package 2018-06-08 16:36:04 +01:00
Luke Kysow
b531705429 Split out config elements into separate files 2018-06-08 15:55:55 +01:00
Luke Kysow
69c788ec66 Rename package repoconfig to yaml 2018-06-07 15:40:48 +01:00
Luke Kysow
d06f3ca3d2 Implement custom run step 2018-06-06 22:12:30 +01:00
Luke Kysow
aef8a632c3 Make tests more readable 2018-06-06 18:54:27 +01:00
Luke Kysow
2175b50472 Use new steps in plan/apply
- Fix lockURL issues by adding new Router object.
- Use new ProjectLocker and delete PreProjectExecutor.
2018-06-05 19:39:10 +01:00
Luke Kysow
7dfab213e8 Parse config and build execution plan. 2018-06-05 17:23:58 +01:00
Luke Kysow
75a55dd696 Moved into new package 2018-06-05 17:13:13 +01:00
Luke Kysow
42b6646cbe Implement config reader and parser 2018-06-05 17:12:19 +01:00
Luke Kysow
06f68b88e4 Add TF_WORKSPACE env var when execing terraform
Even though we're switching to the right workspace this is a nice
safeguard to have. I don't think it incurs additional time.
2018-06-05 17:08:56 +01:00
Luke Kysow
464cd51eae Implement plan step. 2018-06-05 17:08:39 +01:00
Luke Kysow
692e4144ed Implement init step. 2018-06-05 17:07:49 +01:00
Luke Kysow
6dc0e3c3f3 Implement apply step. 2018-06-05 17:07:31 +01:00
Luke Kysow
8ee16a0281 By default atlantis plan will run in root dir.
This change makes things cleaner because there will only ever be one
plan generated in the comment flow. It's okay to make this change
because typing the plan command a couple times isn't too bad AND we're
going to be implementing autoplanning which should handle most of the
times you needed to type plan from before.
2018-06-05 17:06:57 +01:00
Luke Kysow
93c4be3a53 Fix some spelling errors. 2018-05-30 18:59:26 +02:00
Luke Kysow
143fb82bd2 Use new mux.SetURLVars function for testing. 2018-05-30 18:48:12 +02:00
Luke Kysow
a57d4c6618 Comment on pull request when lock discarded.
When the lock is discarded from the Atlantis UI, comment back on pull
request so users know the lock was discarded.

- Adds the BaseRepo field to the PullRequest model.
- This change is backwards compatible with previous installations where
the DB will have a Project model with a PullRequest without the BaseRepo
field.
2018-05-30 16:38:40 +02:00
mo-hit
9df3609e6e WIP Implement commenting on pull when lock deleted. 2018-05-30 16:28:58 +02:00
Luke Kysow
64ebc8dd2f Fix bug with GitLab approvals not being required
Updated to a patched version of go-gitlab with the correct fields set.
2018-04-26 10:54:27 -06:00
Luke Kysow
3f5ad53af6 Make repo whitelist case insensitive.
This is okay to do because it's a better user experience and because
GitLab and GitHub project names are case insensitive as well.
2018-03-30 12:59:22 -07:00
Luke Kysow
f21cf09417 Refactor to use VCS Host in Repo model. 2018-03-27 12:43:20 -07:00
Luke Kysow
7117586bc6 Move VCSHost into models.
This will enable using the VCS type in other packages and avoid circular
dependencies. It also makes sense that this is part of the Repo model.
2018-03-27 12:00:52 -07:00
Luke Kysow
102d3f60c2 Log if err updating commit status. 2018-03-23 11:06:51 -07:00
Luke Kysow
6bf86df046 Merge pull request #82 from runatlantis/speedup
Add plugin cache. Don't run workspace if unneeded.
2018-03-20 15:08:47 -07:00
Luke Kysow
b507bd0712 Add plugin cache. Don't run workspace if unneeded.
- run terraform with TF_PLUGIN_CACHE_DIR set so that terraform init will
be faster.
- check which workspace we're in and don't switch unless we need to.
- run terraform with TF_IN_AUTOMATION set so the plan output doesn't
have instructions that don't make sense. Ex.
```
This plan was saved to: /tmp/atlantis/data/repos/lkysow/atlantis-example/3/default/default.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "/tmp/atlantis/data/repos/lkysow/atlantis-example/3/default/default.tfplan"
```
2018-03-20 15:05:12 -07:00
Luke Kysow
85ab7475f8 Validate workspace the same way as Terraform.
Saw in the TF code how they were validating workspace names
and decided to do the same. '..' is actually a valid TF workspace but we
don't support that.
2018-03-19 20:27:02 -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
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