Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update terragrunt version #1884

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ inputs:
terragrunt-version:
description: Terragrunt version
required: false
default: v0.55.5
default: v0.73.7
opentofu-version:
description: OpenTofu version
required: false
Expand Down Expand Up @@ -272,6 +272,7 @@ runs:
format('{0}/cache', github.workspace) ||
inputs.terraform-cache-dir }}
echo "TF_PLUGIN_CACHE_DIR=$CACHE_DIR" >> $GITHUB_ENV
echo "TG_PROVIDER_CACHE_DIR=$CACHE_DIR" >> $GITHUB_ENV
echo "TERRAGRUNT_PROVIDER_CACHE_DIR=$CACHE_DIR" >> $GITHUB_ENV

- uses: actions/cache/restore@v4
Expand Down Expand Up @@ -400,6 +401,7 @@ runs:
INPUT_DRIFT_DETECTION_SLACK_NOTIFICATION_URL: ${{ inputs.drift-detection-slack-notification-url }}
NO_BACKEND: ${{ inputs.no-backend }}
DEBUG: 'true'
TG_PROVIDER_CACHE: ${{ inputs.cache-dependencies == 'true' && 1 || 0 }}
TERRAGRUNT_PROVIDER_CACHE: ${{ inputs.cache-dependencies == 'true' && 1 || 0 }}
DIGGER_RUN_SPEC: ${{inputs.digger-spec}}
run: |
Expand Down Expand Up @@ -439,6 +441,7 @@ runs:
INPUT_DIGGER_COMMAND: ${{ inputs.command }}
INPUT_DRIFT_DETECTION_SLACK_NOTIFICATION_URL: ${{ inputs.drift-detection-slack-notification-url }}
NO_BACKEND: ${{ inputs.no-backend }}
TG_PROVIDER_CACHE: ${{ inputs.cache-dependencies == 'true' && 1 || 0 }}
TERRAGRUNT_PROVIDER_CACHE: ${{ inputs.cache-dependencies == 'true' && 1 || 0 }}
DIGGER_RUN_SPEC: ${{inputs.digger-spec}}
id: digger
Expand All @@ -460,7 +463,7 @@ runs:
with:
path: $TF_PLUGIN_CACHE_DIR
key: digger-cache-${{ hashFiles('**/cache') }}

branding:
icon: globe
color: purple
14 changes: 8 additions & 6 deletions cli/pkg/digger/digger.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ package digger
import (
"errors"
"fmt"
"log"
"os"
"path"
"strings"
"time"

"github.com/diggerhq/digger/libs/backendapi"
"github.com/diggerhq/digger/libs/ci"
comment_updater "github.com/diggerhq/digger/libs/comment_utils/summary"
Expand All @@ -12,11 +18,6 @@ import (
"github.com/diggerhq/digger/libs/policy"
orchestrator "github.com/diggerhq/digger/libs/scheduler"
"github.com/diggerhq/digger/libs/storage"
"log"
"os"
"path"
"strings"
"time"

core_drift "github.com/diggerhq/digger/cli/pkg/core/drift"
"github.com/diggerhq/digger/cli/pkg/usage"
Expand Down Expand Up @@ -68,7 +69,8 @@ func RunJobs(jobs []orchestrator.Job, prService ci.PullRequestService, orgServic
defer reporter.Flush()

log.Printf("Info: [TF_PLUGIN_CACHE_DIR=%v] ", os.Getenv("TF_PLUGIN_CACHE_DIR"))
log.Printf("Info: [TERRAGRUNT_PROVIDER_CACHE_DIR=%v", os.Getenv("TERRAGRUNT_PROVIDER_CACHE_DIR"))
log.Printf("Info: [TG_PROVIDER_CACHE_DIR=%v] ", os.Getenv("TG_PROVIDER_CACHE_DIR"))
log.Printf("Info: [TERRAGRUNT_PROVIDER_CACHE_DIR=%v] ", os.Getenv("TERRAGRUNT_PROVIDER_CACHE_DIR"))

runStartedAt := time.Now()

Expand Down
5 changes: 4 additions & 1 deletion libs/execution/terragrunt.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,12 @@ func (terragrunt Terragrunt) runTerragruntCommand(command string, printOutputToS
env := os.Environ()
env = append(env, "TF_CLI_ARGS=-no-color")
env = append(env, "TF_IN_AUTOMATION=true")
env = append(env, "TERRAGRUNT_FORWARD_TF_STDOUT=1")
env = append(env, "TERRAGRUNT_NO_COLOR=true")
env = append(env, "TERRAGRUNT_NON_INTERACTIVE=true")
env = append(env, "TERRAGRUNT_FORWARD_TF_STDOUT=1")
env = append(env, "TG_NO_COLOR=true")
env = append(env, "TG_NON_INTERACTIVE=true")
env = append(env, "TG_TF_FORWARD_STDOUT=true")

for k, v := range envs {
env = append(env, fmt.Sprintf("%s=%s", k, v))
Expand Down