Commit Graph

92 Commits

Author SHA1 Message Date
Andrew Jeffree
e140823408 Add flag for configuring git-credentials-store
--write-git-creds will create a .git-credentials file and configure
git to use it. To allow authentication with your git remotes over https.
To access private repos.
2019-08-02 10:12:30 +10:00
Luke Kysow
ee8707d239 Add flag for setting Terraform Enterprise hostname (#706)
--tfe-hostname will allow for creating a .terraformrc file with a
different hostname than app.terraform.io
2019-07-12 15:19:43 +01:00
Luke Kysow
7595265a6b Finishing touches to disable-apply-all
- fix missing part of a test
- log when ignoring
2019-05-23 12:09:51 -04:00
Will Soula
b77a09dc97 Add --disable-apply-all flag
Add a flag to disable the use of the command `atlantis apply` so you
can enforce that each plan must be applied separately.
2019-05-23 12:09:51 -04:00
Luke Kysow
fa7b21faf7 Warn if tokens have newline
I don't think any tokens accept newlines, so warn if the tokens have
one. Usually this is the result of a mistake when deploying Atlantis
which is hard to debug.
2019-04-09 16:25:12 -03:00
Luke Kysow
efcc13756a New help format.
A new help format that keeps everything at 80 chars.
2019-03-30 20:26:35 -05:00
Luke Kysow
8982a67b78 Run latest goimports 2019-03-30 20:22:49 -05:00
Luke Kysow
b12d487cb2 Add new --repo-config-json flag
This flag will allow users to specify repo config as json instead of
writing a file to disk. This is useful in deployments where disk access
is more difficult, ex. Docker.
2019-03-27 19:52:58 -05:00
Luke Kysow
e163b47ebd Change Atlantis tagline.
Atlantis has been focused on TF pull request automation for the last
year so I want to rename its tagline to be more focused.
2019-03-27 14:59:37 -05:00
Luke Kysow
d78b106cab Refactor @jjulien's server-side config work. 2019-03-27 14:47:48 -05:00
John Julien
1fcdaba719 Added new --repo-config option and deprecated --allow-repo-config
This enables atlantis.yaml in all repos, but by default restricts
certain sensitive keys from being used.

The keys apply_requirements, workflow, and workflows can only be
specified in an atlantis.yaml file if explicitly allowed by a
server side repo config.

The repo config file provides the ability to specify a default set of
workflows, and default values for apply_requirements and workflow to use
use on a per repo basis.  It also supports applying to a collection of
repos by using regex to match a repo name.

If more than one repo name matches, the values from last repo matched
are used.

This deprecates the --allow-repo-config option
2019-03-27 14:47:48 -05:00
Luke Kysow
ca58ebd7e0 Autodownload tf versions. Add --default-tf-version.
This changeset has two features:
1. We now automatically download the version of terraform specified in
atlantis.yaml configs if we don't already have that version available
locally.

2. Add a new --default-tf-version flag that allows users to set a
default version of Terraform that we will also download if it's not on
disk.

These mean that users don't need to build custom Docker images to just
add terraform versions. It also means that upgrading the version of
terraform that is packaged with the Atlantis Docker image won't cause
issues for existing users because as long as they're running with
--default-tf-version, Atlantis will always use that version.
2019-03-14 13:51:27 -05:00
Luke Kysow
74e9bbb82b Add automerge feature.
Automerging merges pull requests automatically if all plans have been
successfully applied.

* Save status of PR's to BoltDB so after each apply, we can check if
there are pending plans.
* Add new feature where we delete successful plans *unless* all plans
have succeeded *if* automerge is enabled. This was requested by users
because when automerge is enabled, they want to enforce that a pull
request's changes have been fully applied. They asked that plans not be
allowed to be applied "piecemeal" and instead, all plans must be
generated successfully prior to allowing any plans to be applied.
2019-02-06 16:27:43 -06: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
70235d8e8f Update to latest linters. Fix errors. 2019-01-22 13:29:42 -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
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
c4f89958d3 Tweak logging. Add timezone, use everywhere.
- Use logger for all warnings. Previously we were writing warnings from
cmd/server.go directly to stderr which bypassed our normal log format.
- Add the timezone to log output. This is just really nice to have if
you're looking at old logs.
- Change levels to all be 4 characters: DBUG, INFO, WARN, EROR. This
makes the logs easier to read because it lines up.
- Log when we first receive the request as well as when we send a
response. This makes it easier to see where the request starts and ends.
2018-12-19 13:40:13 -06:00
Brenden Matthews
e001353ae9 Add mergeable requirement.
Introduce new `mergeable` requirement, in similar vein to the `approved`
requirement. Ran `make go-generate` to update mocks accordingly.

This addresses issue #43.
2018-12-11 16:00:04 -05:00
Luke Kysow
fa4aad4a74 Refine basepath changes.
- Refactoring work from https://github.com/runatlantis/atlantis/pull/314
- Use just the path in templates, not the fully qualified URL since that
is a best practice.
- Add logging to errors when rendering templates.
- Silence help output on cli errors since the help output is now so
large that you have to scroll up to see the errors.
2018-11-21 11:33:31 -06:00
Jonathan Lange
670131fa63 Prefix URLs in templates with AtlantisURL
Resolves #213

Allows users to run Atlantis behind a shared reverse proxy, which is a fairly
common use case.
2018-11-06 11:03:58 +00:00
Luke Kysow
0d97452c67 Remove 'through GitHub and GitLab' from help description.
We now support Bitbucket so this is inaccurate and also it's not
going to scale to keep adding all the VCS hosts we support.
2018-10-30 10:21:37 -05:00
Matt McFarland
23b56238b1 Add initial implementation of --silence-whitelist-errors server flag 2018-10-11 15:25:24 -05:00
Luke Kysow
e9b7001266 Add godocs. Refactor ProjectResult. Golint errors. 2018-08-30 16:47:17 -06: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
5a842fb0bf Fix gometalinter errors 2018-07-24 17:02:01 +02:00
Luke Kysow
af03ff36e2 Update security warnings. 2018-07-23 12:31:00 +02:00
Luke Kysow
1fc4667c63 WIP bitbucket 2018-07-19 21:52:33 +02:00
Luke Kysow
9b2d037373 Add .gometalint.json config
After update of errcheck, needed to explicitly disable checking fmt
functions.
2018-07-05 13:54:10 +02:00
Luke Kysow
8effd01125 Test new allow-repo-config flag 2018-07-02 19:01:40 +02:00
Luke Kysow
13a70c772d Add new --allow-repo-config flag. 2018-06-30 23:27:15 +02:00
Luke Kysow
b4993b60ea Rename bootstrap to testdrive.
Bootstrap is meant for a system that sets itself up. This command is
more like a testing mode so I want to rename it to avoid confusion.

Fixes #129 and came out of #117.
2018-05-30 13:35:05 +02:00
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
dcb73d2f31 Error during atlantis bootstrap if ngrok running 2018-03-20 12:46:22 -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
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
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