-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lukasz Gryglicki <[email protected]>
- Loading branch information
1 parent
4bc8ac9
commit 871101f
Showing
6 changed files
with
84 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# STAGE=prod ./utils/scan.sh signatures signature_reference_id 29df5aa6-a396-4543-968c-f6e15f011d43 | ||
if [ -z "$STAGE" ] | ||
then | ||
STAGE=dev | ||
fi | ||
if [ "$STAGE" = "dev" ] | ||
then | ||
schema='dynamodb_product_us_east1_dev' | ||
prefix='cla_dev_' | ||
fi | ||
if [ "$STAGE" = "prod" ] | ||
then | ||
schema='dynamodb_product_us_east_1' | ||
prefix='cla_prod_' | ||
fi | ||
if [ -z "$1" ] | ||
then | ||
echo "you need to specify table to query as a 1st parameter, for example 'signatures'" | ||
echo "possible tables include: approvals, ccla_whitelist_requests, cla_manager_requests, companies, company_invites, events, gerrit_instances, github_orgs, gitlab_orgs, metrics, projects, projects_cla_groups, repositories, session_store, signatures, store, user_permissions, users" | ||
exit 1 | ||
fi | ||
if [ -z "$2" ] | ||
then | ||
echo "$0: you need to specify '$1' table's column as a 2nd argument, see columns:" | ||
snowsql $(cat ./snowflake.secret) -o friendly=false -o header=true -o timing=false -o output_format=plain -q "select * from fivetran_ingest.${schema}.${prefix}${1} limit 1" | ||
exit 2 | ||
fi | ||
if [ -z "$3" ] | ||
then | ||
echo "$0: you need to specify '$1' table '$2' column value to search for" | ||
exit 3 | ||
fi | ||
aws --profile "lfproduct-${STAGE}" dynamodb scan --table-name "cla-${STAGE}-${1}" --filter-expression "contains(${2},:v)" --expression-attribute-values "{\":v\":{\"S\":\"${3}\"}}" --max-items 100 | jq -r '.Items' |
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,11 @@ | ||
#!/bin/bash | ||
if [ -z "$STAGE" ] | ||
then | ||
STAGE=dev | ||
fi | ||
if [ -z "$1" ] | ||
then | ||
aws --profile lfproduct-${STAGE} dynamodb scan --table-name cla-${STAGE}-companies --max-items 100 | ||
else | ||
aws --profile lfproduct-${STAGE} dynamodb scan --table-name cla-${STAGE}-companies --filter-expression "contains(${1},:v)" --expression-attribute-values "{\":v\":{\"S\":\"${2}\"}}" --max-items 100 | ||
fi |
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,11 @@ | ||
#!/bin/bash | ||
if [ -z "$STAGE" ] | ||
then | ||
STAGE=dev | ||
fi | ||
if [ -z "$1" ] | ||
then | ||
aws --profile lfproduct-${STAGE} dynamodb scan --table-name cla-${STAGE}-events --max-items 100 | ||
else | ||
aws --profile lfproduct-${STAGE} dynamodb scan --table-name cla-${STAGE}-events --filter-expression "contains(${1},:v)" --expression-attribute-values "{\":v\":{\"S\":\"${2}\"}}" --max-items 100 | ||
fi |
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,2 +1,11 @@ | ||
#!/bin/bash | ||
aws --profile lfproduct-dev dynamodb scan --table-name cla-dev-projects --max-items 3 | ||
if [ -z "$STAGE" ] | ||
then | ||
STAGE=dev | ||
fi | ||
if [ -z "$1" ] | ||
then | ||
aws --profile lfproduct-${STAGE} dynamodb scan --table-name cla-${STAGE}-projects --max-items 100 | ||
else | ||
aws --profile lfproduct-${STAGE} dynamodb scan --table-name cla-${STAGE}-projects --filter-expression "contains(${1},:v)" --expression-attribute-values "{\":v\":{\"S\":\"${2}\"}}" --max-items 100 | ||
fi |
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,12 @@ | ||
#!/bin/bash | ||
# add: | jq -r '.[].signature_acl' | ||
if [ -z "$STAGE" ] | ||
then | ||
STAGE=dev | ||
fi | ||
if [ -z "$1" ] | ||
then | ||
aws --profile "lfproduct-${STAGE}" dynamodb scan --table-name "cla-${STAGE}-users" --max-items 100 | jq -r '.Items' | ||
else | ||
aws --profile "lfproduct-${STAGE}" dynamodb scan --table-name "cla-${STAGE}-users" --filter-expression "contains(${1},:v)" --expression-attribute-values "{\":v\":{\"S\":\"${2}\"}}" --max-items 100 | jq -r '.Items' | ||
fi |