From 070fd3e925746c09222ba536047e9a21cdf6ce7f Mon Sep 17 00:00:00 2001 From: Byron Morales <97176439+ByWefox@users.noreply.github.com> Date: Tue, 12 Dec 2023 03:30:38 +0100 Subject: [PATCH 1/5] docs: Update using-atlantis.md (#4003) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update using-atlantis.md I was having problems with `atlantis apply` when I wanted to apply all pending plans. The problem was that every time I tried to execute this action, I got "Ran Apply for 0 projects:" because atlantis, for the apply action, did not know where the tfstates were. I think this is something that we can add in the documentation, because I did not find this clarification The problem was that every time I tried to execute this action, I was getting "Ran Apply for 0 projects:" due to atlantis, for the apply action, didn’t know where the tfstates were located. I think it's something we can add in the documentation, because I didn’t find this aclaration * Update runatlantis.io/docs/using-atlantis.md --------- Co-authored-by: PePe Amengual --- runatlantis.io/docs/using-atlantis.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runatlantis.io/docs/using-atlantis.md b/runatlantis.io/docs/using-atlantis.md index 8009440a14..15a0b5a681 100644 --- a/runatlantis.io/docs/using-atlantis.md +++ b/runatlantis.io/docs/using-atlantis.md @@ -103,8 +103,10 @@ Runs `terraform apply` for the plan that matches the directory/project/workspace ::: tip If no directory/project/workspace is specified, ex. `atlantis apply`, this command will apply **all unapplied plans from this pull request**. This includes all projects that have been planned manually with `atlantis plan` `-p`/`-d`/`-w` since the last autoplan or `atlantis plan` command. +For Atlantis commands to work, Atlantis needs to know the location where the plan file is. For that, you can use $PLANFILE which will contain the path of the plan file to be used in your custom steps. i.e `terraform plan -out $PLANFILE` ::: + ### Examples ```bash # Runs apply for all unapplied plans from this pull request. From ce95f8ee0512806112b62d5febac006ce09f1e36 Mon Sep 17 00:00:00 2001 From: Marcos Diez Date: Mon, 11 Dec 2023 23:34:33 -0300 Subject: [PATCH 2/5] feat: Jobs now shown in a table in the main page (#3784) * feat: better logging for UpdateStatus * feat: jobs now shown in a table in the main page --------- Co-authored-by: PePe Amengual --- server/controllers/templates/web_templates.go | 38 ++++++++- server/events/vcs/instrumented_client.go | 10 ++- .../mock_project_command_output_handler.go | 32 ++++++++ server/jobs/project_command_output_handler.go | 82 +++++++++++++++---- .../project_command_output_handler_test.go | 10 ++- server/server.go | 44 +++++++++- server/server_test.go | 19 +++-- server/static/css/custom.css | 19 +++++ 8 files changed, 221 insertions(+), 33 deletions(-) diff --git a/server/controllers/templates/web_templates.go b/server/controllers/templates/web_templates.go index f5295fcd45..177a6428b4 100644 --- a/server/controllers/templates/web_templates.go +++ b/server/controllers/templates/web_templates.go @@ -17,6 +17,8 @@ import ( "html/template" "io" "time" + + "github.com/runatlantis/atlantis/server/jobs" ) //go:generate pegomock generate --package mocks -o mocks/mock_template_writer.go TemplateWriter @@ -50,7 +52,9 @@ type ApplyLockData struct { // IndexData holds the data for rendering the index page type IndexData struct { - Locks []LockIndexData + Locks []LockIndexData + PullToJobMapping []jobs.PullInfoWithJobIDs + ApplyLock ApplyLockData AtlantisVersion string // CleanedBasePath is the path Atlantis is accessible at externally. If @@ -113,8 +117,8 @@ var IndexTemplate = template.Must(template.New("index.html.tmpl").Parse(`

Locks

- {{ if .Locks }} {{ $basePath := .CleanedBasePath }} + {{ if .Locks }}
Repository @@ -151,6 +155,36 @@ var IndexTemplate = template.Must(template.New("index.html.tmpl").Parse(`

No locks found.

{{ end }}
+
+
+
+
+

Jobs

+ {{ if .PullToJobMapping }} +
+
+ Repository + Project + Workspace + Jobs +
+ {{ range .PullToJobMapping }} +
+ {{.Pull.RepoFullName}} #{{.Pull.PullNum}} + {{.Pull.Path}} + {{.Pull.Workspace}} + + {{ range .JobIDInfos }} + + {{ end }} + +
+ {{ end }} +
+ {{ else }} +

No jobs found.

+ {{ end }} +