Commit Graph

292 Commits

Author SHA1 Message Date
Luke Kysow
16cdcf1165 Remove "Refreshing..." output from top of plan.
When running terraform plan, Terraform writes a line for each resource
it updates. For example:

	null_resource.b: Refreshing state... (ID: 700288721293508840)
	null_resource.a: Refreshing state... (ID: 2853194762920164292)
	null_resource.f: Refreshing state... (ID: 6634469389761751950)

This change removes those lines by splitting the output string after a
separator.

This change is being made because the Refreshing output isn't important
and it will make the comments shorter.
2018-10-30 16:27:55 -05:00
Luke Kysow
2d214b2727 Restrict possible project names.
We should only allow project names (which are specified in an
atlantis.yaml file) that don't need to be url escaped. The one
exceptional character is '/' which we allow because users like to name
their projects to match the directory they're in. We use the same rule
that Terraform uses for workspace names.

I've also changed the characters that are replaced when writing out the
plan filename to only remove invalid filename characters instead of just
allowing alphanumeric. This is the smallest amount of change required to
ensure the filename is valid.
2018-10-30 13:01:48 -05:00
John Lin
b652568798 replace all invalid char in plan filename 2018-10-30 11:43:24 -05:00
Luke Kysow
4d3c567d87 Make project locked message look better.
When the plan fails, it gets the error prepended with **Plan Failed**:.
Thus we don't need to add our own "**Unable to run plan**" error.
2018-10-30 11:16:16 -05:00
Luke Kysow
4fcece0f9d Fix tests when git config uses gpg signing.
- some of the tests run git so if you're using gpg signing you need
  to disable that.
- refactor test helpers to use tb.Helper() and make the error output red.
  This is useful because if another helper uses one of these helpers,
  when it calls .Helper() its output will also be up the stack.
2018-10-30 11:15:46 -05:00
marc bassil
189b0591ef Updating message when project is locked. 2018-10-26 14:03:08 -04:00
Matt McFarland
05a0b09402 Remove unneccessary NewRepo call in tests 2018-10-16 12:47:26 -05:00
Matt McFarland
901cc0aa20 Update per requested changes, fix typos in test comments 2018-10-16 12:43:13 -05:00
Matt McFarland
23b56238b1 Add initial implementation of --silence-whitelist-errors server flag 2018-10-11 15:25:24 -05:00
Luke Kysow
e98caf3094 Quote args and plan path that may contain spaces.
Bitbucket repo owner names can contain spaces. Need to quote everywhere
these might be used because we're executing with sh -c.
2018-10-01 19:04:48 -05:00
Luke Kysow
e69c36ad55 Add new -var args for tf plan.
Previously we added -var atlantis_repo=runatlantis/atlantis but the '/'
character is not a valid character for the AWS assume role session name.
To fix this, this commit adds -var atlantis_repo_owner=runatlantis and
-var atlantis_repo_name=atlantis (where runatlantis and atlantis would
be the values for the repo the pull request is from ).
2018-10-01 11:35:45 -05:00
Luke Kysow
5d05f3df3b Fix multi-project output.
Was causing output to look broken for GitHub.
2018-09-28 10:21:18 -05:00
Luke Kysow
c56aa9e104 Quote the -out variable in terraform plan.
Fixes #290. In Bitbucket Server, the repo owner name can have spaces.
This causes errors when running terraform plan -out path with spaces so
we need to quote it: terraform plan -out "path with spaces".
2018-09-27 15:40:47 -05:00
Jeremy Olexa
c278bac6be Execute tf with vars that give source of run.
Add new variables to execute TF with:
  -var atlantis_repo=owner/repo
  -var atlantis_pull_num=10

These can be used within TF to set the session_name of the AWS session
that Terraform creates. This allows all API calls to be traced back to a
specific pull request and user.
2018-09-25 12:31:20 -05:00
Luke Kysow
411b8f87f1 Merge pull request #278 from runatlantis/commentfolding
Fold long output. Fix diff highlighting.
2018-09-15 09:17:58 -07:00
Luke Kysow
bac2ee7619 Fold long output. Fix diff highlighting.
* If output is longer than 12 lines, wrap it in markdown folding for
GitLab and GitHub.
* Reformat the Terraform plan output so that the + and - lines show up
highlighted properly when using the diff syntax highlighting
2018-09-15 09:12:43 -07:00
Luke Kysow
e8c7d819b5 Inputfalse (#277)
Add input=false to init, plan, and apply step runners
2018-09-14 14:47:51 -07:00
Luke Kysow
af419ef3e1 Fix gometalint errors 2018-09-07 10:54:48 -07:00
Luke Kysow
f057d6d7d9 Merge pull request #247 from runatlantis/godocs
Add godocs. Refactor ProjectResult. Golint errors.
2018-09-07 10:39:42 -07:00
Luke Kysow
e9b7001266 Add godocs. Refactor ProjectResult. Golint errors. 2018-08-30 16:47:17 -06:00
Ben Abrams
a80e285270 change server startup log message from warn to info level
Server startup should be something expected therefore an info rather than a warning.

```
2018/08/28 18:37:50 [WARN] server: Atlantis started - listening on port 4141
```

Signed-off-by: Ben Abrams <me@benabrams.it>
2018-08-28 11:56:37 -07:00
Luke Kysow
b8a90a5807 Remove accidentally checked in file. 2018-08-23 15:43:44 -10:00
Luke Kysow
307cd31361 Release 0.4.7 2018-08-23 15:36:24 -10:00
Luke Kysow
5fb3ac115e Support GitLab subgroups.
GitLab allows repos to be nested under multiple subgroups,
for example owner/group/subgroup/subsubgroup/repo vs. owner/repo. This
change enables that functionality.
2018-08-23 10:24:54 -10:00
Luke Kysow
3e650dc3a0 Fix error parsing tf version when TF_LOG set 2018-08-21 08:52:25 -10:00
Luke Kysow
756435e467 Expose repo name, owner, and branch to run step runner for custom steps (#232)
Commits by @mootpt (squashed)
2018-08-20 11:13:27 -10:00
Luke Kysow
13f79f3963 Split init step test into its own. 2018-08-17 13:52:43 -10:00
Jeff Knurek
62f7526db4 INIT: if the init cmd fails providing more info in the logs is helpful 2018-08-17 13:51:32 -10:00
Luke Kysow
44f3036e7a New landing page 2018-08-16 13:02:09 -10:00
Luke Kysow
c72cd95202 Print commands to run in comments. 2018-08-10 09:26:53 -10:00
Luke Kysow
3b02a1fc31 Test plan/apply all. 2018-08-09 14:23:44 -10:00
Luke Kysow
5a3bb96c3c Fix gometalint issues 2018-08-08 17:08:08 -10:00
Luke Kysow
f8be04e6c6 Update tests for apply all 2018-08-08 17:08:08 -10:00
Luke Kysow
12a9a19fde First pass at naked plan/apply working on all. 2018-08-08 17:08:08 -10:00
Luke Kysow
5ee990cec1 Don't default dir and workspace.
Lay groundwork for atlantis plan/apply to work on everything.
2018-08-08 17:08:08 -10:00
Luke Kysow
a217e1f880 Add comment to apply all with atlantis apply 2018-08-08 17:08:08 -10:00
Luke Kysow
0bf295bf72 Ensure dir is cleaned. 2018-08-08 17:08:08 -10:00
Luke Kysow
a201c8a1bb Ignore extra newlines in comments.
Accept comments like
```
atlantis plan

```
So that when a comment is copy-pasted in GitHub and GitHub adds two
newlines, Atlantis still parses that comment.
2018-08-02 20:43:09 -07:00
Luke Kysow
6940bfa57e Rename enum 2018-08-02 20:26:05 -07:00
Luke Kysow
ff85cbef70 Require approval from someone other than PR author
In Bitbucket cloud, the pull request author can approve their own pull
request. Ignore this approval.

Fixes #201
2018-07-28 06:57:49 -07:00
Luke Kysow
6e14c200f3 URL encode auth to avoid url issues. 2018-07-25 14:49:47 +02:00
Luke Kysow
5d43445505 Test models 2018-07-25 13:14:02 +02:00
Luke Kysow
da236e953b Test Bitbucket Server 2018-07-24 20:34:01 +02:00
Luke Kysow
e8c0f7c5bb Add webhook secret checking. 2018-07-24 20:25:20 +02:00
Luke Kysow
33926a01f2 WebHook -> Webhook 2018-07-24 20:24:27 +02:00
Luke Kysow
a4c48f5d47 Add provisional Bitbucket Server support 2018-07-24 20:23:51 +02:00
Luke Kysow
718619c045 Rename Bitbucket to BitbucketCloud 2018-07-24 20:23:51 +02:00
Luke Kysow
c21e577e51 Add bitbucket cloud/server events 2018-07-24 20:23:51 +02:00
Luke Kysow
d1a78cfa51 Switch to map instead of switch 2018-07-24 20:23:51 +02:00
Luke Kysow
5a842fb0bf Fix gometalinter errors 2018-07-24 17:02:01 +02:00