Skip to content

Commit 495ef4c

Browse files
committed
Merging dev with master
2 parents 65b3587 + 05ed7a0 commit 495ef4c

46 files changed

Lines changed: 502 additions & 74 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ logs
44

55
# config cache
66
config.prod.py
7+
config.dev.py
78
config.test.py
89
config.py
910

@@ -36,4 +37,4 @@ client_secret.json
3637

3738
.serverless/*
3839
package-lock.json
39-
node_modules/**
40+
node_modules/**

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.6.6/envs/lcs-venv
1+
3.9.1/envs/lcs-venv

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ language: python
33

44
#Set up the basic environment to be python
55
python:
6-
- "3.6.6"
6+
- "3.9.1"
77

88
#Recognize mongodb as a service
99
services:

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Credit to Kirollos and Anarav for work on Dockerfile
2+
# Commands to build and run using this Dockerfile
3+
# docker pull nikolaik/python-nodejs:python3.9-nodejs14
4+
# docker build -t lcs .
5+
# docker run -p 3000:3000 -p 3001:3001 -p 3002:3002 -it --name serverless lcs
6+
7+
# if you make changes do not hesistate to run docker rm serverless
8+
# followed by the docker build and docker run commands to test out your changes!
9+
10+
# Setup base image for python and nodejs
11+
FROM nikolaik/python-nodejs:python3.9-nodejs16
12+
13+
14+
# And our requirements, and install them
15+
ADD requirements.txt /
16+
RUN pip3 install -r requirements.txt
17+
18+
# Add package and package-lock to determine required dependencies
19+
ADD package.json /
20+
21+
# Install the node packages outlined in package-lock.json (if present) or package.json
22+
RUN npm install
23+
RUN npm install -g serverless
24+
25+
# Add serverless.yml for lambda functions
26+
ADD serverless.yml /
27+
28+
# Add all of our python files
29+
ADD *.py /
30+
ADD ./templates /templates
31+
ADD ./src /src
32+
33+
# Run serverless offline
34+
EXPOSE 3000
35+
ENTRYPOINT ["node_modules/.bin/sls", "offline", "--host", "0.0.0.0", "start"]

config.example.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
'channel': ''
1414
}
1515

16-
SPARKPOST_KEY = ""
17-
16+
EMAIL_ADDRESS = ""
17+
#Must use a generated app password for gmail
18+
EMAIL_PASSWORD = ""
1819

1920
class GOOGLE_CAL:
2021
CAL_ID = ""

config.travis.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"slack messages": "slackMessages"
1313
}
1414

15+
EMAIL_ADDRESS = os.getenv("TRAVIS_TEST_EMAIL_ADDRESS")
16+
EMAIL_PASSWORD = os.getenv("TRAVIS_TEST_EMAIL_PASSWORD")
17+
1518
SPARKPOST_KEY = os.getenv("TRAVIS_SPARKPOST_KEY", "")
1619

1720
SLACK_KEYS = {

deployment/config.dev.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
'channel': os.getenv("DEVELOP_SLACK_CHANNEL_ID")
1919
}
2020

21+
EMAIL_ADDRESS = os.getenv("DEVELOP_EMAIL_ADDRESS"),
22+
EMAIL_PASSWORD = os.getenv("DEVELOP_EMAIL_PASSWORD")
2123

2224
class GOOGLE_CAL:
2325
CAL_ID = os.getenv("DEVELOP_GOOGLE_CAL_ID", "")
@@ -55,7 +57,7 @@ class GOOGLE_CAL:
5557
}
5658
RESUME_BUCKET = os.getenv("DEVELOP_RESUME_BUCKET", "")
5759
WAIVER_BUCKET = os.getenv("DEVELOP_WAIVER_BUCKET", "")
58-
60+
VACCINE_BUCKET = os.getenv("DEVELOP_VACCINE_BUCKET", "")
5961
# Json webtoken
6062
JWT_SECRET = os.getenv("DEVELOP_JWT_SECRET", "")
6163
JWT_ALGO = os.getenv("DEVELOP_JWT_ALGO", "")

deployment/config.prod.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
'channel': os.getenv("PRODUCTION_SLACK_CHANNEL_ID")
2020
}
2121

22+
EMAIL_ADDRESS = os.getenv("PRODUCTION_EMAIL_ADDRESS"),
23+
EMAIL_PASSWORD = os.getenv("PRODUCTION_EMAIL_PASSWORD")
24+
2225
class GOOGLE_CAL:
2326
CAL_ID = os.getenv("PRODUCTION_GOOGLE_CAL_ID", "")
2427
CAL_API_KEY = os.getenv("PRODUCTION_GOOGLE_CAL_API_KEY", "")

deployment/deploy_develop.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ declare -a env_vars=(
2121
"DEVELOP_SLACK_CHANNEL_ID"
2222
"DEVELOP_RESUME_BUCKET"
2323
"DEVELOP_WAIVER_BUCKET"
24+
"DEVELOP_VACCINE_BUCKET"
2425
"DEVELOP_AWS_ACCESS_KEY_ID"
25-
"DEVELOP_AWS_SECRET_ACCESS_KEY")
26+
"DEVELOP_AWS_SECRET_ACCESS_KEY"
27+
"DEVELOP_EMAIL_ADDRESS"
28+
"DEVELOP_EMAIL_PASSWORD")
2629

2730
echo "For loop"
2831
# Disabled environment variables:
@@ -39,6 +42,15 @@ do
3942
printenv $i >> .env.dev
4043
done
4144

45+
wget https://raw.githubusercontent.com/creationix/nvm/v0.31.0/nvm.sh -O ~/.nvm/nvm.sh;
46+
source ~/.nvm/nvm.sh;
47+
48+
nvm use 14
49+
50+
##Checking Package Versions
51+
echo "Checking Node..."
52+
node -v
53+
4254
# Deploying!
4355
echo "Deploying!"
44-
npx serverless deploy --stage dev
56+
npx serverless deploy --stage dev

deployment/deploy_production.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ declare -a env_vars=(
3838
"PRODUCTION_DAY_OF_END_YEAR"
3939
"PRODUCTION_DAY_OF_END_MONTH"
4040
"PRODUCTION_DAY_OF_END_DAY"
41-
"PRODUCTION_DAY_OF_END_HOUR")
41+
"PRODUCTION_DAY_OF_END_HOUR"
42+
"PRODUCTION_EMAIL_ADDRESS"
43+
"PRODUCTION_EMAIL_PASSWORD")
4244

4345
echo "For loop"
4446
# Disabled environment variables

0 commit comments

Comments
 (0)