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

Misc updates #1

Open
wants to merge 4 commits into
base: master
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
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0
4.2.1
12 changes: 6 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_rules_go",
sha256 = "7904dbecbaffd068651916dce77ff3437679f9d20e1a7956bff43826e7645fcc",
sha256 = "8e968b5fcea1d2d64071872b12737bbb5514524ee5f0a4f54f5920266c261acb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.25.1/rules_go-v0.25.1.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.25.1/rules_go-v0.25.1.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
],
)

http_archive(
name = "bazel_gazelle",
sha256 = "222e49f034ca7a1d1231422cdb67066b885819885c356673cb1f72f748a3c9d4",
sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
],
)

Expand Down
4 changes: 3 additions & 1 deletion codegen/cmd/cue-terraform-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import (
"os"
"path/filepath"
"sort"
"strings"

"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/format"
"github.com/iancoleman/strcase"
"github.com/zclconf/go-cty/cty"
)

const codegenComment = "Generated by cue-terraform-gen (https://github.com/tnarg/cue_terraform_gen). DO NOT EDIT."
const codegenComment = "Generated by cue-terraform-gen (https://github.com/tnarg/cue_terraform). DO NOT EDIT."

type Schemas struct {
FormatVersion string `json:"format_version"`
Expand All @@ -25,6 +26,7 @@ type Schemas struct {
func (s *Schemas) ToCue() []*ast.File {
var files []*ast.File
for pname, pschema := range s.ProviderSchemas {
pname:= strings.Replace(pname, "registry.terraform.io/hashicorp/", "", -1)
pkg := cuePackage(pname)
pkg.AddComment(cueCommentGroupDoc(cueComment(codegenComment)))

Expand Down
2 changes: 1 addition & 1 deletion codegen/cue-terraform-gen.bash.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if [ -z "$TERRAFORM_PROVIDER_SCHEMA" ]; then
fi

if [ -z "${BUILD_WORKSPACE_DIRECTORY-}" ]; then
echo "error: BUILD_WORKSPACE_DIRECOTRY not set" >&2
echo "error: BUILD_WORKSPACE_DIRECTORY not set" >&2
exit 1
fi
pushd "${BUILD_WORKSPACE_DIRECTORY}" > /dev/null
Expand Down
10 changes: 5 additions & 5 deletions codegen/tools.bzl
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

_terraform_toolchains = {
"0.12.25": [
"1.0.2": [
{
"os": "darwin",
"arch": "amd64",
"sha256": "179fc99ccea5ed3617e9e7026dcfa59a5916ea91162afd7a2acd8350906a0d68",
"sha256": "90e58796d84db0a16b5ad40140182061533c38210680980e099812c43b43ff7a",
},
{
"os": "linux",
"arch": "amd64",
"sha256": "e95daabd1985329f87e6d40ffe7b9b973ff0abc07a403f767e8658d64d733fb0",
"sha256": "7329f887cc5a5bda4bedaec59c439a4af7ea0465f83e3c1b0f4d04951e1181f4",
},
{
"os": "windows",
"arch": "amd64",
"sha256": "81356460648abc8e6b76974c518be7989c6fd6f497bb3c604988fd876b363321",
"sha256": "bb515146c49619f78cc141449765fe0290a9d5f955fef8ed59215e163495a3db",
},
],
}

def terraform_toolchains(version = "0.12.25"):
def terraform_toolchains(version = "1.0.2"):
for platform in _terraform_toolchains[version]:
http_archive(
name = "terraform_toolchain_%s_%s" % (platform["os"].lower(), platform["arch"]),
Expand Down
10 changes: 7 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ module github.com/tnarg/cue_terraform
go 1.14

require (
cuelang.org/go v0.2.0 // indirect
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 // indirect
github.com/zclconf/go-cty v1.4.1 // indirect
cuelang.org/go v0.4.0
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/iancoleman/strcase v0.2.0
github.com/pkg/errors v0.9.1 // indirect
github.com/zclconf/go-cty v1.9.1
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
)
Loading