diff --git a/.circleci/config.yml b/.circleci/config.yml index 0b63fb92b..e1f1a3446 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: e2e: working_directory: /go/src/github.com/runatlantis/atlantis docker: - - image: circleci/golang:1.10 + - image: circleci/golang:1.11 environment: TERRAFORM_VERSION: 0.11.8 steps: @@ -28,7 +28,7 @@ jobs: docker_master: working_directory: /go/src/github.com/runatlantis/atlantis docker: - - image: circleci/golang:1.10 + - image: circleci/golang:1.11 steps: - checkout - run: make build-service @@ -51,7 +51,7 @@ jobs: docker_tag: working_directory: /go/src/github.com/runatlantis/atlantis docker: - - image: circleci/golang:1.10 + - image: circleci/golang:1.11 steps: - checkout - run: make build-service diff --git a/runatlantis.io/docs/deployment.md b/runatlantis.io/docs/deployment.md index c52ddf4d3..ecb97a802 100644 --- a/runatlantis.io/docs/deployment.md +++ b/runatlantis.io/docs/deployment.md @@ -44,6 +44,7 @@ If installing on a single repository, navigate to the repository home page and c - double-check you added `/events` to the end of your URL. - set **Content type** to `application/json` - set **Secret** to a random key (https://www.random.org/strings/). You'll need to pass this value to the `--gh-webhook-secret` flag when you start Atlantis + - **NOTE** If you're adding a webhook to multiple repositories, each repository will need to use the **same** secret. - select **Let me select individual events** - check the boxes - **Pull request reviews** @@ -59,6 +60,7 @@ If you're using GitLab, navigate to your project's home page in GitLab - set **URL** to `http://$URL/events` (or `https://$URL/events` if you're using SSL) where `$URL` is where Atlantis is hosted. **Be sure to add `/events`** - double-check you added `/events` to the end of your URL. - set **Secret Token** to a random key (https://www.random.org/strings/). You'll need to pass this value to the `--gitlab-webhook-secret` flag when you start Atlantis + - **NOTE** If you're adding a webhook to multiple repositories, each repository will need to use the **same** secret. - check the boxes - **Push events** - **Comments** @@ -66,8 +68,6 @@ If you're using GitLab, navigate to your project's home page in GitLab - leave **Enable SSL verification** checked - click **Add webhook** -**NOTE:** If you are using Atlantis with multiple GitLab repositories, you must either use the same Integration secret token across all GitLab repositories, or use a separate Atlantis instance for each repository. The former approach is recommended.** - ### Bitbucket Cloud (bitbucket.org) Webhook - Go to your repo's home page - Click **Settings** in the sidebar @@ -94,6 +94,7 @@ If you're using GitLab, navigate to your project's home page in GitLab - set **URL** to `http://$URL/events` (or `https://$URL/events` if you're using SSL) where `$URL` is where Atlantis is hosted. **Be sure to add `/events`** - Double-check you added `/events` to the end of your URL. - Set **Secret** to a random key (https://www.random.org/strings/). You'll need to pass this value to the `--bitbucket-webhook-secret` flag when you start Atlantis + - **NOTE** If you're adding a webhook to multiple repositories, each repository will need to use the **same** secret. - Under **Repository** select **Push** - Under **Pull Request**, select: Opened, Modified, Merged, Declined, Deleted and Comment added - Click **Save**Bitbucket Webhook diff --git a/server/events/command_runner_test.go b/server/events/command_runner_test.go index 62e674c58..37c54f1a8 100644 --- a/server/events/command_runner_test.go +++ b/server/events/command_runner_test.go @@ -59,11 +59,11 @@ func setup(t *testing.T) *vcsmocks.MockClientProxy { MarkdownRenderer: &events.MarkdownRenderer{}, GithubPullGetter: githubGetter, GitlabMergeRequestGetter: gitlabGetter, - Logger: logger, - AllowForkPRs: false, - AllowForkPRsFlag: "allow-fork-prs-flag", - ProjectCommandBuilder: projectCommandBuilder, - ProjectCommandRunner: projectCommandRunner, + Logger: logger, + AllowForkPRs: false, + AllowForkPRsFlag: "allow-fork-prs-flag", + ProjectCommandBuilder: projectCommandBuilder, + ProjectCommandRunner: projectCommandRunner, } return vcsClient } diff --git a/server/events/runtime/run_step_runner.go b/server/events/runtime/run_step_runner.go index 44de3d7b5..c8b88d7c1 100644 --- a/server/events/runtime/run_step_runner.go +++ b/server/events/runtime/run_step_runner.go @@ -32,15 +32,15 @@ func (r *RunStepRunner) Run(ctx models.ProjectCommandContext, command []string, customEnvVars := map[string]string{ "WORKSPACE": ctx.Workspace, "ATLANTIS_TERRAFORM_VERSION": tfVersion, - "DIR": path, - "PLANFILE": filepath.Join(path, GetPlanFilename(ctx.Workspace, ctx.ProjectConfig)), - "BASE_REPO_NAME": ctx.BaseRepo.Name, - "BASE_REPO_OWNER": ctx.BaseRepo.Owner, - "HEAD_REPO_NAME": ctx.HeadRepo.Name, - "HEAD_REPO_OWNER": ctx.HeadRepo.Owner, - "HEAD_BRANCH_NAME": ctx.Pull.Branch, - "PULL_NUM": fmt.Sprintf("%d", ctx.Pull.Num), - "PULL_AUTHOR": ctx.Pull.Author, + "DIR": path, + "PLANFILE": filepath.Join(path, GetPlanFilename(ctx.Workspace, ctx.ProjectConfig)), + "BASE_REPO_NAME": ctx.BaseRepo.Name, + "BASE_REPO_OWNER": ctx.BaseRepo.Owner, + "HEAD_REPO_NAME": ctx.HeadRepo.Name, + "HEAD_REPO_OWNER": ctx.HeadRepo.Owner, + "HEAD_BRANCH_NAME": ctx.Pull.Branch, + "PULL_NUM": fmt.Sprintf("%d", ctx.Pull.Num), + "PULL_AUTHOR": ctx.Pull.Author, } finalEnvVars := baseEnvVars diff --git a/server/events_controller_test.go b/server/events_controller_test.go index 830b2d96a..9adce2518 100644 --- a/server/events_controller_test.go +++ b/server/events_controller_test.go @@ -178,10 +178,10 @@ func TestPost_GitlabCommentNotWhitelisted(t *testing.T) { Logger: logging.NewNoopLogger(), CommentParser: &events.CommentParser{}, GitlabRequestParserValidator: &server.DefaultGitlabRequestParserValidator{}, - Parser: &events.EventParser{}, - SupportedVCSHosts: []models.VCSHostType{models.Gitlab}, - RepoWhitelistChecker: &events.RepoWhitelistChecker{}, - VCSClient: vcsClient, + Parser: &events.EventParser{}, + SupportedVCSHosts: []models.VCSHostType{models.Gitlab}, + RepoWhitelistChecker: &events.RepoWhitelistChecker{}, + VCSClient: vcsClient, } requestJSON, err := ioutil.ReadFile(filepath.Join("testfixtures", "gitlabMergeCommentEvent_notWhitelisted.json")) Ok(t, err) diff --git a/testdrive/utils.go b/testdrive/utils.go index bdb059282..7c9dedb9e 100644 --- a/testdrive/utils.go +++ b/testdrive/utils.go @@ -52,7 +52,7 @@ func downloadFile(url string, path string) error { } defer output.Close() // nolint: errcheck - response, err := http.Get(url) + response, err := http.Get(url) // nolint: gosec if err != nil { return err } @@ -99,7 +99,7 @@ func unzip(archive, target string) error { func getTunnelAddr() (string, error) { tunAPI := fmt.Sprintf("http://%s/api/tunnels", ngrokAPIURL) - response, err := http.Get(tunAPI) + response, err := http.Get(tunAPI) // nolint: gosec if err != nil { return "", err } diff --git a/testing/Dockerfile b/testing/Dockerfile index c38b83ab6..f86b2a7c0 100644 --- a/testing/Dockerfile +++ b/testing/Dockerfile @@ -1,7 +1,7 @@ # This Dockerfile builds the docker image used for running circle ci tests. # We need terraform installed for our full test suite so it installs that. # It's updated by running make build-testing-image -FROM circleci/golang:1.10 +FROM circleci/golang:1.11 # Install Terraform ENV TERRAFORM_VERSION=0.11.8