-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
30 changed files
with
114,792 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/test/indexer/data/* linguist-generated=true | ||
/attic/* linguist-generated=true | ||
/docs/*.svg linguist-generated=true | ||
/terraform/_schema.json linguist-generated=true |
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
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,40 @@ | ||
""" | ||
Save Terraform version and schema information to the file specified | ||
in AZUL_TRACKED_SCHEMA_PATH or verify that the Terraform information | ||
in that file is up-to-date. | ||
""" | ||
import argparse | ||
import logging | ||
import sys | ||
|
||
from azul.logging import ( | ||
configure_script_logging, | ||
) | ||
from azul.terraform import ( | ||
terraform, | ||
) | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
def check_schema() -> None: | ||
schema = terraform.schema | ||
if schema.versions != terraform.versions: | ||
raise RuntimeError(f"Cached Terraform schema is out of date. " | ||
f"Run '{sys.executable} {__file__} update' " | ||
f"and commit {schema.path}") | ||
|
||
|
||
if __name__ == '__main__': | ||
configure_script_logging() | ||
commands = { | ||
'update': terraform.update_schema, | ||
'check': check_schema | ||
} | ||
# https://youtrack.jetbrains.com/issue/PY-41806 | ||
# noinspection PyTypeChecker | ||
parser = argparse.ArgumentParser(description=__doc__, | ||
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||
parser.add_argument('command', choices=commands) | ||
arguments = parser.parse_args() | ||
commands[arguments.command]() |
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
Oops, something went wrong.