Commit Graph

905 Commits

Author SHA1 Message Date
Luke Kysow
2c6b87d09b Merge pull request #451 from runatlantis/tfe-free-docs
Update docs to point at tfe free link.
2019-02-01 09:56:37 -05:00
Luke Kysow
34e3bfdb85 Update docs to point at tfe free link. 2019-02-01 09:55:04 -05:00
Luke Kysow
84c89ba7ea Merge pull request #442 from runatlantis/slack-token
Add slack-token to flags.
2019-01-22 22:32:21 -05:00
Luke Kysow
7aca997a06 Add missing period to flag docs. 2019-01-22 22:30:30 -05:00
Jacob Foard
2e65e03055 Adding in slack-token to flags
Signed-off-by: Jacob Foard <jacob.foard@formation.ai>
2019-01-22 22:30:30 -05:00
Luke Kysow
5341e7d843 Merge pull request #441 from runatlantis/website-testing
Test website for broken links during build.
2019-01-22 22:25:08 -05:00
Luke Kysow
8cb27aba02 Test website for broken links during build. 2019-01-22 22:21:36 -05:00
Luke Kysow
c0b89d9f1f Merge pull request #440 from runatlantis/gometalint
Update to latest linters. Fix errors.
2019-01-22 13:32:42 -05:00
Luke Kysow
70235d8e8f Update to latest linters. Fix errors. 2019-01-22 13:29:42 -05:00
Luke Kysow
d2c2e8de4f Merge pull request #439 from runatlantis/tfe-docs
Tfe docs
2019-01-22 12:16:08 -05:00
Luke Kysow
505ec77a5c Remove website-link-check build step.
This step doesn't work for forked pull requests so I'm removing it for
now.
2019-01-22 12:03:21 -05:00
Luke Kysow
61269e547b Update TFE free remote state mgmt docs 2019-01-22 12:02:31 -05:00
Luke Kysow
56b09b6d14 Merge pull request #433 from runatlantis/checkout-strategy
Document checkout strategy
2019-01-17 10:13:32 -05:00
Luke Kysow
108ffd8eea Document checkout strategy 2019-01-17 10:10:12 -05:00
Luke Kysow
a9d5feac84 Merge pull request #427 from runatlantis/checkout-strategy
Add new --checkout-strategy flag
2019-01-17 10:09:51 -05:00
Luke Kysow
16a4946bea Test new checkout logic. 2019-01-16 18:32:02 -05:00
Luke Kysow
3b7542b392 Merge pull request #430 from runatlantis/skipped-test
Fix skipped test
2019-01-16 17:52:40 -05:00
Luke Kysow
054d3bc5f6 Fix skipped test 2019-01-16 12:13:37 -05:00
Luke Kysow
501db6b66e Fix gometalinter errors
Also disable test linters since we already run tests.
2019-01-15 15:45:01 -05:00
Luke Kysow
8b77b95a16 Add checkout-strategy flag.
This flag can be set to either branch (default) or merge. If set to
branch, we will check out the head branch of the pull request (the
source). If set to merge, we will check out the base branch of the pull
request (the destination) and then attempt to perform a git merge of the
pull request branch. This simulates what will happen if the pull request
is merged.

This allows us to perform terraform commands on what the state of the
repo will be *after* the pull request is merged. This is useful if users
are often opening up pull requests from branches that aren't up to date
with master. With the branch strategy, the terraform plan might be
deleting resources that have been created in the master branch but with
the merge strategy, we merge the branch's changes into the master branch
and so don't have this problem.
2019-01-15 15:45:01 -05:00
Luke Kysow
d2abdb569a Provide base branch name in pull request model
This is needed in order to support the ability to check out the repo as
it would appear after the pull request is merged into the base branch.
2019-01-15 13:45:35 -05:00
Luke Kysow
164c6c222d Merge pull request #422 from runatlantis/plan-step-document
Document need to manually select workspace
2019-01-11 13:18:43 -05:00
Luke Kysow
3c975f37f1 Document need to manually select workspace
If users are overriding the default plan command then they need to
select the workspace themselves.

Fixes #405
2019-01-11 13:09:06 -05:00
Luke Kysow
173fdde739 Merge pull request #421 from runatlantis/handle-panics
Fix bug where Atlantis hangs on terraform crash.
2019-01-10 19:52:29 -05:00
Luke Kysow
1d7bb42955 Fix tests 2019-01-10 19:46:29 -05:00
Luke Kysow
3f1a5596c1 Vendor go-linereader 2019-01-10 17:42:30 -05:00
Luke Kysow
b1e32643f5 Fix bug where Atlantis hangs on terraform crash.
Because of some weirdness with how terraform executes (it forks itself
and assigns the parent's stderr and stdout file descriptors to the
child) when terraform panics, Go's exec.CombinedOutput() blocks
indefinitely even though the terraform process has exited.

To handle this, we switch to using os.Pipe for the cmd's stderr/out
which for some reason allows Go to know when the process has exited.
Unfortunately, this brings up a new problem when reading the output from
that pipe. For some reason, after a terraform crash, we never get an EOF
on the pipe and so as we again get in a situation where we're blocking
indefinitely. To handle this, I've added an edge case where we look at
the log lines and if its the end of a terraform panic, we break out of
the loop.

Thanks Terraform 0.12-alpha for discovering this bug!
2019-01-10 17:42:30 -05:00
Luke Kysow
acf46ba89d Merge pull request #419 from runatlantis/tfe-token
Add optional tfe-token flag. Get working with 0.12.
2019-01-10 17:26:20 -05:00
Luke Kysow
e0dcb5ab13 Don't add extra -var flags when using TF >= 0.12
In Terraform 0.12 and above, you aren't allowed to set -var foo=bar
flags unless the foo variable is actually defined in code. Previously,
we were setting the following variables:
- atlantis_user
- atlantis_repo
- atlantis_repo_owner
- atlantis_repo_name
- atlantis_pull_num

Users could then use these variables if they wanted to, in their code.
The main use case was to name the assume role session in AWS:

provider "aws" {
  assume_role {
    role_arn     = "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME"
    session_name = "${var.atlantis_user}-${var.atlantis_repo_owner}-${var.atlantis_repo_name}-${var.atlantis_pull_num}"
  }
}

This is longer possible in 0.12.
2019-01-10 15:16:21 -05:00
Luke Kysow
fb86e89df0 Add new --tfe-token flag for TFE backend.
The new flag takes in a Terraform Enterprise API token and attempts to
write a config file for that token to ~/.terraformrc on startup.
If the file already exists and its contents would change as a result of
us writing it, we error out.
This flag is useful if you're using the TFE backend for any of your
projects as that requires a .terraformrc file with a token for
authentication.
2019-01-09 15:11:01 -05:00
Luke Kysow
7caa043fe6 Organize fields alphabetically 2019-01-09 14:49:56 -05:00
Luke Kysow
6d2fd4314d Merge pull request #417 from runatlantis/tfe-state-docs
Add docs about using tfe remote state.
2019-01-09 09:51:01 -05:00
Luke Kysow
255a5b7fc1 Add docs about using tfe remote state. 2019-01-08 16:00:49 -05:00
Luke Kysow
89516f0378 Merge pull request #415 from runatlantis/moved-files
Include src of moved files in list of modified files
2019-01-07 16:49:54 -05:00
Luke Kysow
cc03368e60 Merge pull request #411 from runatlantis/docs-reorg
Reorganize docs.
2019-01-07 16:39:15 -05:00
Luke Kysow
3d8138d3fa Include moved files in GetModifiedFiles
Implement the change from the previous commit for GitLab and Bitbucket
Server/Cloud. Test the change for GitHub.

If a file is moved, we want to run plan in the directory it is moved to
*and* the directory it was moved from.
2019-01-07 16:36:09 -05:00
Luke Kysow
37e2ab85a8 Reorganize docs.
Also add a build step that checks the Netlify deploy preview for broken
links.
2019-01-07 16:10:21 -05:00
Kent Bredeson
aaf075b281 Add old path of moved file to list of modified files 2019-01-07 14:12:28 -06:00
Luke Kysow
5d072683e5 Merge pull request #409 from runatlantis/version-parser
Fix version detection so it works with tf 0.12alpha
2019-01-04 09:29:43 -05:00
Luke Kysow
3bb7c8d52f Fix version detection so it works with tf 0.12alph 2019-01-04 09:26:06 -05:00
Luke Kysow
8b395df20c Merge pull request #408 from Phylu/patch-1
docs: Add information about background commands
2018-12-20 21:40:12 -06:00
Janosch Maier
49a1b638c6 docs: Add information about background commands 2018-12-21 01:13:48 +01:00
Luke Kysow
41059d71f1 Merge pull request #407 from runatlantis/bump-test-image-tf-version
Document how to update the testing image.
v0.4.13
2018-12-20 13:26:03 -06:00
Luke Kysow
1df4be945c Document how to update the testing image. 2018-12-20 13:18:02 -06:00
Luke Kysow
f338209376 Merge pull request #406 from runatlantis/release-0.4.13
Release v0.4.13
2018-12-20 13:14:22 -06:00
Luke Kysow
9f3a7f2a08 Release v0.4.13 2018-12-20 13:11:37 -06:00
Luke Kysow
4c665b75c4 Merge pull request #403 from runatlantis/warn-target
Warn if using -target flag with apply.
2018-12-19 14:32:08 -06:00
Luke Kysow
a6ca764e87 Merge pull request #402 from runatlantis/logging-tweaks
Tweak logging. Add timezone, use everywhere.
2018-12-19 14:26:55 -06:00
Luke Kysow
d6917e49dc Merge pull request #396 from runatlantis/workspace-configured
If dir has workspaces configured only allow those
2018-12-19 14:26:35 -06:00
Luke Kysow
58493f3402 Warn if using -target flag with apply.
-target doesn't work with terraform apply when the apply is being run on
a planfile (which is how Atlantis runs plan). We should give the user an
error if they attempt this.

Fixes #399
2018-12-19 14:25:46 -06:00