Skip to content

Commit

Permalink
Merge pull request #192 from CheckMateSG/develop
Browse files Browse the repository at this point in the history
2.8.0
  • Loading branch information
sarge1989 authored Nov 5, 2023
2 parents b710d09 + 3d94b33 commit 7b45043
Show file tree
Hide file tree
Showing 26 changed files with 3,123 additions and 1,269 deletions.
10 changes: 7 additions & 3 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"projects": {
"default": "checkmate-373101"
}
}
"default": "checkmate-373101",
"prod": "checkmate-373101",
"uat": "checkmate-uat"
},
"targets": {},
"etags": {}
}
28 changes: 23 additions & 5 deletions .github/workflows/firebase-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Deploy Cloud Functions

on:
workflow_dispatch:
push:
branches:
- main
- develop
paths:
- 'functions/**'
- "functions/**"

jobs:
build_and_deploy:
runs-on: ubuntu-latest
Expand All @@ -22,15 +25,30 @@ jobs:
${{ runner.os }}-node-
- name: Create env file
run: |
echo "${{ secrets.ENV_FILE }}" > .env
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
echo "${{ secrets.ENV_FILE }}" > .env
else
echo "${{ secrets.ENV_FILE_NONPROD }}" > .env
fi
working-directory: functions
- name: Build Cloud Functions
run: npm ci
working-directory: functions
- name: Create SA key
run: echo '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}' > $HOME/gcloud.json
run: |
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
echo '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}' > $HOME/gcloud.json
else
echo '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NONPROD }}' > $HOME/gcloud.json
fi
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Deploy Cloud Functions
run: export GOOGLE_APPLICATION_CREDENTIALS=$HOME/gcloud.json && npm run deploy
working-directory: functions
run: |
export GOOGLE_APPLICATION_CREDENTIALS=$HOME/gcloud.json
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
npm run deploy -- --project checkmate-373101
else
npm run deploy -- --project checkmate-uat
fi
working-directory: functions
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Start docker compose for testing
run: docker-compose -f docker-compose-base.yml up -d
- name: Wait for emulator to start
run: timeout 30 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:15001/checkmate-373101/asia-southeast1/healthcheck)" != "200" ]]; do sleep 1; done' || false
run: timeout 30 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:15001/checkmate-uat/asia-southeast1/healthcheck)" != "200" ]]; do sleep 1; done' || false
- name: Install newman and lodash
run: npm ci
working-directory: integration-tests
Expand Down
1 change: 1 addition & 0 deletions documentation/dataSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ erDiagram
string referralId "referral code"
number referralCount
map utm "map containing utm parameters, source, medium, content, campaign, term"
string language "en or cn, users preferred language"
}
message ||--|{ instance: has
Expand Down
5 changes: 5 additions & 0 deletions functions/.env.checkmate-uat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NUM_SHARDS_INSTANCE_COUNT=5
NUM_SHARDS_VOTE_COUNT=5
GRAPH_API_VERSION=v15.0
ENVIRONMENT=UAT
SIMILARITY_THRESHOLD=0.85
3 changes: 2 additions & 1 deletion functions/.env.local.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ TYPESENSE_PROTOCOL=http
EMBEDDER_HOST=http://embedder-server:12344
TELEGRAM_REPORT_CHANNEL_ID=111111111
TEST_IMAGE_URL=TEST
HASHIDS_SALT=SALT
HASHIDS_SALT=SALT
WEBHOOK_PATH=whatsapp
2 changes: 1 addition & 1 deletion functions/.secret.local.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WHATSAPP_TOKEN=WHATSAPP_TOKEN
TELEGRAM_CHECKER_BOT_TOKEN=TELEGRAM_CHECKER_BOT_TOKEN
TELEGRAM_REPORT_BOT_TOKEN=TELEGRAM_REPORT_BOT_TOKEN
VERIFY_TOKEN=VERIFY_TOKEN
BITLY_TOKEN=BITLY_TOKEN
OPENAI_API_KEY=OPEN_API_KEY
TYPESENSE_TOKEN=TYPESENSE_TOKEN
ML_SERVER_TOKEN=ML_SERVER_TOKEN
TELEGRAM_BOT_TOKEN=TELEGRAM_BOT_TOKEN
Expand Down
Loading

0 comments on commit 7b45043

Please sign in to comment.