The data and DB for bracket.club.
Watchers
entries
scores
Sports
ncaam
ncaaw
nba
nhl
wcm
wcw
node watchers/$WATCHER --sport=$SPORT --year=$YEAR
# Any command run through this npm run-script will use check the hostname==localhost
# to see if it should run in PRODUCTION mode. You can also pass NODE_ENV=production to force it
# They will also use the current year for $YEAR
# Start only one
npm start $WATCHER $SPORT
# Run other pm2 commnads
npm start $WATCHER $SPORT restart
npm start $WATCHER $SPORT stop
npm start $WATCHER $SPORT delete
npm start $WATCHER $SPORT logs
For the score watcher to run properly, each of the teams from bracket-data
should have a match against wherever the scores are fetched. This can be done inside bracket-data
by cloning that repo and running the npm run names
command. If there are any names missing, then the bracket-data
package should be published and pulled into this project before npm start scores
is run.
# Connects to the DB and adds masters/entries/users to all sports every 5 seconds
npm run integration
# Want you probably want to do if you missed something today.
# Since order of masters matters in the database the --teams param order
# is important. This will take the current bracket and look up the scores for today
# (or use --date) and apply each result that the teams played in.
NODE_ENV=production npm run insert-by-team -- --sport ncaaw --teams uconn "notre dame"
NODE_ENV=production npm run find-entry -- --sport ncaam --year 2018 --tweet TWEET_ID
# Connection string will come from NODE_ENV and it will save to sql/$ENV.sql
NODE_ENV=production npm run dump
# Create a .env file with all the necessary env vars for production
echo "TWITTER_KEY=$TWITTER_KEY" >> .env
echo "TWITTER_SECRET=$TWITTER_SECRET" >> .env
echo "TWITTER_TOKEN=$TWITTER_TOKEN" >> .env
echo "TWITTER_TOKEN_SECRET=$TWITTER_TOKEN_SECRET" >> .env
echo "POSTGRES_URL=$POSTGRES_URL" >> .env
# Open a psql shell
npm run heroku:psql
# Import current local sql file to production
npm run heroku:psql < sql/production.sql
# Open webpage to heroku DB
npm run heroku:web
# Create or rebuild the linode based on the current stackscript
# Pass it a path to a public key in order to allow SSH access
# The .env file will be used to populate vars to the Linode
npm run deploy build
# Update the stackscript with whats in the repo
npm run deploy stackscript
# IP address of linode
npm run deploy ip
# Delete linode
npm run deploy delete
bracket-data
with new year and teamsnpm install bracket-data@latest --save
in web app and this reponpm run dump:prod-to-dev
node watchers/entries --sport=$SPORT --year=$YEAR
api
and postgres locallynpm run deploy build
ssh
into linode and run cd data; npm start entries ncaam
ssh bc "cat ~/data/logs/pm2/entries-ncaam.log"
npm start scores ncaam
bracket data
and check npm run names
works to ensure that the names in bracket-data
all match the scoreboardscores
and check that the tests pass, especially the ones getting data directly from urls. If anything breaks, fix and write new testsnpm start scores ncaam
locally once the first games startssh
into linode and run cd data; npm start scores ncaam