Skip to content

Commit 0601eb4

Browse files
A few more util scripts
Signed-off-by: Lukasz Gryglicki <[email protected]>
1 parent 016ba75 commit 0601eb4

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

utils/active_signature_py.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# select key, data:expire from fivetran_ingest.dynamodb_product_us_east_1.cla_prod_store where key like 'active_signature:%' order by data:expire desc limit 1;
55
# API_URL=https://api.lfcla.dev.platform.linuxfoundation.org DEBUG=1 ./utils/active_signature_py.sh '4b344ac4-f8d9-11ed-ac9b-b29c4ace74e9'
66
# API_URL=https://api.lfcla.dev.platform.linuxfoundation.org DEBUG=1 ./utils/active_signature_py.sh '4b344ac4-f8d9-11ed-ac9b-b29c4ace74e9'
7+
# API_URL=https://api.easycla.lfx.linuxfoundation.org DEBUG='' ./utils/active_signature_py.sh '564e571e-12d7-4857-abd4-898939accdd7'
78

89
if [ -z "$1" ]
910
then

utils/lookup_store_ddb.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# STAGE=prod ./utils/lookup_store_ddb.sh 'active_signature:564e571e-12d7-4857-abd4-898939accdd7'
3+
if [ -z "$1" ]
4+
then
5+
echo "$0: you need to specify key as a 1st argument"
6+
echo "example: 'active_signature:564e571e-12d7-4857-abd4-898939accdd7'"
7+
exit 1
8+
fi
9+
if [ -z "${STAGE}" ]
10+
then
11+
export STAGE=dev
12+
fi
13+
14+
aws --profile "lfproduct-${STAGE}" dynamodb get-item --table-name "cla-${STAGE}-store" --key "{\"key\": {\"S\": \"${1}\"}}" | jq -r '.'

utils/lookup_store_sf.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
# STAGE=prod ./utils/lookup_store_sf.sh 'active_signature:f6a0ed33-917b-4336-b4c3-145f0f357274'
3+
if [ -z "$1" ]
4+
then
5+
echo "$0: you need to specify key as a 1st argument"
6+
echo "example: 'active_signature:564e571e-12d7-4857-abd4-898939accdd7'"
7+
exit 1
8+
fi
9+
if [ -z "${STAGE}" ]
10+
then
11+
export STAGE=dev
12+
fi
13+
if [ "${STAGE}" = "prod" ]
14+
then
15+
snowsql $(cat ./snowflake.secret) -o friendly=false -o header=false -o timing=false -o output_format=plain -q "select data from fivetran_ingest.dynamodb_product_us_east_1.cla_prod_store where key = '${1}'" | jq -r '.'
16+
else
17+
snowsql $(cat ./snowflake.secret) -o friendly=false -o header=false -o timing=false -o output_format=plain -q "select data from fivetran_ingest.dynamodb_product_us_east1_dev.cla_dev_store where key = '${1}'" | jq -r '.'
18+
fi

0 commit comments

Comments
 (0)