-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
terraform-provider: init provider scaffolding (#2632)
* terraform-provider: init Signed-off-by: Moritz Sanft <[email protected]> * terraform-provider: add basic docgen Signed-off-by: Moritz Sanft <[email protected]> * terraform-provider: fix build steps Signed-off-by: Moritz Sanft <[email protected]> * terraform-provider: extend build process and docgen Signed-off-by: Moritz Sanft <[email protected]> * dev-docs: document provider usage Signed-off-by: Moritz Sanft <[email protected]> * bazel: upload aspect lib mirror Signed-off-by: Moritz Sanft <[email protected]> * bazel: add docstring to fix linter Signed-off-by: Moritz Sanft <[email protected]> * terraform-provider: don't try to create lockfiles Signed-off-by: Moritz Sanft <[email protected]> * bazel: fix shellcheck issues * bazel: separate paths to check * bazel: explain what updating lockfiles means Signed-off-by: Moritz Sanft <[email protected]> * terraform-provider: fix linter checks Signed-off-by: Moritz Sanft <[email protected]> --------- Signed-off-by: Moritz Sanft <[email protected]>
- Loading branch information
Showing
31 changed files
with
1,350 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
###### script header ###### | ||
|
||
lib=$(realpath @@BASE_LIB@@) || exit 1 | ||
stat "${lib}" >> /dev/null || exit 1 | ||
|
||
# shellcheck source=../sh/lib.bash | ||
if ! source "${lib}"; then | ||
echo "Error: could not find import" | ||
exit 1 | ||
fi | ||
|
||
terraform=$(realpath @@TERRAFORM@@) | ||
stat "${terraform}" >> /dev/null | ||
tfplugindocs=$(realpath @@TFPLUGINDOCS@@) | ||
stat "${tfplugindocs}" >> /dev/null | ||
|
||
cd "${BUILD_WORKSPACE_DIRECTORY}" | ||
|
||
###### script body ###### | ||
|
||
TERRAFORM_PROVIDER_DIR="terraform-provider-constellation" | ||
|
||
# Use hermetic Terraform binary. | ||
PATH="$(dirname "${terraform}"):$PATH" | ||
export PATH | ||
echo Using terraform at "$(command -v terraform)" | ||
|
||
# TODO(msanft): Pin TF version or use built provider to generate schema and feed in here. | ||
${tfplugindocs} generate \ | ||
--provider-dir ${TERRAFORM_PROVIDER_DIR} \ | ||
--provider-name constellation \ | ||
--rendered-provider-name Constellation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"""aspect bazel library""" | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
def aspect_bazel_lib(): | ||
http_archive( | ||
name = "aspect_bazel_lib", | ||
sha256 = "4b32cf6feab38b887941db022020eea5a49b848e11e3d6d4d18433594951717a", | ||
strip_prefix = "bazel-lib-2.0.1", | ||
urls = [ | ||
"https://cdn.confidential.cloud/constellation/cas/sha256/4b32cf6feab38b887941db022020eea5a49b848e11e3d6d4d18433594951717a", | ||
"https://github.com/aspect-build/bazel-lib/releases/download/v2.0.1/bazel-lib-v2.0.1.tar.gz", | ||
], | ||
type = "tar.gz", | ||
) |
Oops, something went wrong.