-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad53ed6
commit dad5f81
Showing
9 changed files
with
73 additions
and
0 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,6 @@ | ||
CLOUD_SQL_INSTANCE_NAME: 'cidc-dfci:us-central1:cidc-postgres' | ||
CLOUD_SQL_DB_USER: 'postgres' | ||
CLOUD_SQL_DB_NAME: 'cidc' | ||
GOOGLE_PROJECT_ID: 'cidc-dfci' | ||
GOOGLE_UPLOAD_BUCKET: 'cidc-uploads-prod' | ||
GOOGLE_UPLOAD_TOPIC: 'uploads' |
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,6 @@ | ||
CLOUD_SQL_INSTANCE_NAME: 'cidc-dfci-staging:us-central1:cidc-postgres' | ||
CLOUD_SQL_DB_USER: 'postgres' | ||
CLOUD_SQL_DB_NAME: 'cidc' | ||
GOOGLE_PROJECT_ID: 'cidc-dfci-staging' | ||
GOOGLE_UPLOAD_BUCKET: 'cidc-uploads-staging' | ||
GOOGLE_UPLOAD_TOPIC: 'uploads' |
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,6 @@ | ||
# IDE workspace configuration | ||
.vscode | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
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,49 @@ | ||
language: "python" | ||
python: | ||
- "3.6" | ||
cache: | ||
directories: | ||
- $HOME/google-cloud-sdk/ | ||
env: | ||
global: | ||
- PYTHONPATH=$PYTHONPATH:$(pwd)/functions | ||
- CLOUDSDK_CORE_DISABLE_PROMPTS=1 | ||
- GOOGLE_APPLICATION_CREDENTIALS=$HOME/credentials.json | ||
- GCLOUD_PROJECT_ID_STAGING=cidc-dfci-staging | ||
- GCLOUD_PROJECT_ID_PROD=cidc-dfci | ||
before_install: | ||
# Install and configure the gcloud SDK. Values for these environment | ||
# variables must be set in the Travis CI console for this to work: | ||
# GCLOUD_SERVICE_ACCOUNT_JSON_STAGING | ||
# -> base64-encoded service account JSON credentials for the staging project | ||
# GCLOUD_SERVICE_ACCOUNT_JSON_PROD | ||
# -> base64-encoded service account JSON credentials for the production project | ||
- if [ ! -d ${HOME}/google-cloud-sdk/bin ]; then | ||
rm -rf $HOME/google-cloud-sdk; | ||
curl https://sdk.cloud.google.com | bash > /dev/null; | ||
fi | ||
- source $HOME/google-cloud-sdk/path.bash.inc | ||
- if [ "$TRAVIS_BRANCH" = production ]; then | ||
gcloud config set project $GCLOUD_PROJECT_ID_PROD; | ||
export GCLOUD_SERVICE_ACCOUNT_JSON="$GCLOUD_SERVICE_ACCOUNT_JSON_PROD"; | ||
else | ||
gcloud config set project $GCLOUD_PROJECT_ID_STAGING; | ||
export GCLOUD_SERVICE_ACCOUNT_JSON="$GCLOUD_SERVICE_ACCOUNT_JSON_STAGING"; | ||
fi | ||
- echo "$GCLOUD_SERVICE_ACCOUNT_JSON" | base64 --decode > $GOOGLE_APPLICATION_CREDENTIALS | ||
- gcloud auth activate-service-account --key-file $GOOGLE_APPLICATION_CREDENTIALS | ||
install: | ||
- pip install -r requirements.txt -r requirements.dev.txt | ||
script: | ||
- pytest | ||
- black --check functions main.py --target-version=py36 | ||
|
||
deploy: | ||
- provider: script | ||
script: echo "Deploy cloud functions to staging here..." | ||
on: | ||
branch: master | ||
- provider: script | ||
script: echo "Deploy cloud functions to production here..." | ||
on: | ||
branch: production |
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,3 @@ | ||
"""Entrypoint for CIDC cloud functions.""" | ||
|
||
from functions import * |
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,2 @@ | ||
black==19.3b0 | ||
pytest==5.0.1 |
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,2 @@ | ||
# The cidc_api_models package | ||
git+https://github.com/CIMAC-CIDC/cidc-api-gae |
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,2 @@ | ||
def test_main(): | ||
pass |