Skip to content

Commit

Permalink
Small improvements to tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
rdettai committed Feb 22, 2024
1 parent 558e2ca commit fac762e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
9 changes: 6 additions & 3 deletions distribution/lambda/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ indexer-package-path:
searcher-package-path:
echo -n $(SEARCHER_PACKAGE_PATH)

bootstrap: package check-env
bootstrap:
cdk bootstrap aws://$$CDK_ACCOUNT/$$CDK_REGION

deploy-hdfs: package check-env
Expand All @@ -65,17 +65,20 @@ deploy-hdfs: package check-env
deploy-mock-data: package check-env
cdk deploy -a cdk/app.py MockDataStack

print-mock-data-metastore: check-env
python -c 'from cdk import cli; cli.print_mock_data_metastore()'

# address https://github.com/aws/aws-cdk/issues/20060
before-destroy:
mkdir -p cdk.out
touch $(INDEXER_PACKAGE_PATH)
touch $(SEARCHER_PACKAGE_PATH)

destroy-hdfs: before-destroy
destroy-hdfs: before-destroy check-env
python -c 'from cdk import cli; cli.empty_hdfs_bucket()'
cdk destroy --force -a cdk/app.py HdfsStack

destroy-mock-data: before-destroy
destroy-mock-data: before-destroy check-env
python -c 'from cdk import cli; cli.empty_mock_data_buckets()'
cdk destroy --force -a cdk/app.py MockDataStack

Expand Down
9 changes: 9 additions & 0 deletions distribution/lambda/cdk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,15 @@ def empty_mock_data_buckets():
_clean_s3_bucket(bucket_name)


def print_mock_data_metastore():
bucket_name = _get_cloudformation_output_value(
app.MOCK_DATA_STACK_NAME, mock_data_stack.INDEX_STORE_BUCKET_NAME_EXPORT_NAME
)
s3 = session.client("s3")
response = s3.get_object(Bucket=bucket_name, Key="index/mock-sales/metastore.json")
print(response["Body"].read().decode())


@cache
def _git_commit():
return subprocess.run(
Expand Down

0 comments on commit fac762e

Please sign in to comment.