-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Add the steps to setup gbq integration testing to the contributing docs #14144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jorisvandenbossche
merged 1 commit into
pandas-dev:master
from
parthea:add-gbq-integration-test-setup-to-docs
Sep 7, 2016
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,35 @@ | ||
#!/bin/bash | ||
|
||
GBQ_JSON_FILE=$1 | ||
GBQ_PROJECT_ID=$2 | ||
|
||
if [[ $# -ne 2 ]]; then | ||
echo -e "Too few arguments.\nUsage: ./travis_encrypt_gbq.sh "\ | ||
"<gbq-json-credentials-file> <gbq-project-id>" | ||
exit 1 | ||
fi | ||
|
||
if [[ $GBQ_JSON_FILE != *.json ]]; then | ||
echo "ERROR: Expected *.json file" | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -f $GBQ_JSON_FILE ]]; then | ||
echo "ERROR: File $GBQ_JSON_FILE does not exist" | ||
exit 1 | ||
fi | ||
|
||
echo "Encrypting $GBQ_JSON_FILE..." | ||
read -d "\n" TRAVIS_KEY TRAVIS_IV <<<$(travis encrypt-file $GBQ_JSON_FILE \ | ||
travis_gbq.json.enc -f | grep -o "\w*_iv\|\w*_key"); | ||
|
||
echo "Adding your secure key and project id to travis_gbq_config.txt ..." | ||
echo -e "TRAVIS_IV_ENV=$TRAVIS_IV\nTRAVIS_KEY_ENV=$TRAVIS_KEY\n"\ | ||
"GBQ_PROJECT_ID='$GBQ_PROJECT_ID'" > travis_gbq_config.txt | ||
|
||
echo "Done. Removing file $GBQ_JSON_FILE" | ||
rm $GBQ_JSON_FILE | ||
|
||
echo -e "Created encrypted credentials file travis_gbq.json.enc.\n"\ | ||
"NOTE: Do NOT commit the *.json file containing your unencrypted" \ | ||
"private key" |
This file contains hidden or 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,3 @@ | ||
TRAVIS_IV_ENV=encrypted_1d9d7b1f171b_iv | ||
TRAVIS_KEY_ENV=encrypted_1d9d7b1f171b_key | ||
GBQ_PROJECT_ID='pandas-travis' |
This file contains hidden or 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 | ||
|
||
source ci/travis_gbq_config.txt | ||
|
||
if [[ -n ${!TRAVIS_IV_ENV} ]]; then | ||
openssl aes-256-cbc -K ${!TRAVIS_KEY_ENV} -iv ${!TRAVIS_IV_ENV} \ | ||
-in ci/travis_gbq.json.enc -out ci/travis_gbq.json -d; | ||
export GBQ_PROJECT_ID=$GBQ_PROJECT_ID; | ||
echo 'Successfully decrypted gbq credentials' | ||
fi | ||
|
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this file already committed? Or will it change due to the script you call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct. The file is already committed. Both
travis_gbq.json.enc
andtravis_gbq_config.txt
will change when users run ``/travis_encrypt_gbq.sh...` so we need to tell users to commit those files (or changes) in a new branch.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok!