From 82fb7fae3adbf7bba6d320d01e04592a7b164445 Mon Sep 17 00:00:00 2001 From: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> Date: Wed, 11 Sep 2024 11:21:20 +0200 Subject: [PATCH] Minor tweaks Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> --- backend/cmd/generate/main.go | 2 +- backend/go.mod | 1 + backend/go.sum | 2 ++ .../moduleindex/moduleschema/tools/build-tofu-binary/main.go | 4 ++-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/cmd/generate/main.go b/backend/cmd/generate/main.go index e37e33cc..d31a7306 100644 --- a/backend/cmd/generate/main.go +++ b/backend/cmd/generate/main.go @@ -39,6 +39,7 @@ func main() { if runtime.GOOS == "windows" { binaryName += ".exe" } + ghToken := os.Getenv("GITHUB_TOKEN") tofuBinaryPath := path.Join("internal", "moduleindex", "moduleschema", "testtofu", binaryName) s3Params := factory.S3Parameters{ AccessKey: os.Getenv("AWS_ACCESS_KEY_ID"), @@ -100,7 +101,6 @@ func main() { } } - ghToken := os.Getenv("GITHUB_TOKEN") backendFactory, err := factory.New(mainLogger, ghToken) if err != nil { mainLogger.Error(ctx, err.Error()) diff --git a/backend/go.mod b/backend/go.mod index d433b2b5..c83d1117 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -24,6 +24,7 @@ require ( github.com/ProtonMail/go-crypto v1.0.0 // indirect github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect github.com/acomagu/bufpipe v1.0.3 // indirect + github.com/apparentlymart/go-shquot v0.0.1 // indirect github.com/aws/aws-sdk-go v1.55.5 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect diff --git a/backend/go.sum b/backend/go.sum index 8915e83c..2f5f9588 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -24,6 +24,8 @@ github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/apparentlymart/go-shquot v0.0.1 h1:MGV8lwxF4zw75lN7e0MGs7o6AFYn7L6AZaExUpLh0Mo= +github.com/apparentlymart/go-shquot v0.0.1/go.mod h1:lw58XsE5IgUXZ9h0cxnypdx31p9mPFIVEQ9P3c7MlrU= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= diff --git a/backend/internal/moduleindex/moduleschema/tools/build-tofu-binary/main.go b/backend/internal/moduleindex/moduleschema/tools/build-tofu-binary/main.go index 54599b6c..48773ad9 100644 --- a/backend/internal/moduleindex/moduleschema/tools/build-tofu-binary/main.go +++ b/backend/internal/moduleindex/moduleschema/tools/build-tofu-binary/main.go @@ -34,11 +34,11 @@ func buildTofu(repoDir string, testTofuDir string, binaryPath string) { return } if _, err := os.Stat(repoDir); err != nil { - runCommand(testTofuDir, "git", "clone", "https://github.com/opentofu/opentofu.git", repoDir) + runCommand(testTofuDir, "git", "clone", "https://github.com/opentofu/opentofu.git", "--shallow", repoDir) } runCommand(repoDir, "git", "pull") runCommand(repoDir, "git", "checkout", "experiment/json_config_dump") - runCommand(repoDir, "go", "build", "-o", filepath.ToSlash(binaryPath), "github.com/opentofu/opentofu/cmd/tofu") + runCommand(repoDir, "go", "build", "-o", filepath.ToSlash(binaryPath), "./cmd/tofu/main.go") } func runCommand(wd string, argv ...string) {