Skip to content

Commit

Permalink
feat: add initial tournament setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
alee committed Jan 31, 2024
1 parent af87091 commit e8a45df
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions scripts/tournament/2024-02/round-1/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

CLI_CMD="${1:-cli}" # in prod change to cli:prod e.g., `./setup.sh cli:prod`

## create February 2024 Mars Madness tournament + Round 1 structure

npm run ${CLI_CMD} -- tournament create --tournamentName="2024-02 Mars Madness" --description="The next Mars Madness tournament begins February 8, 2024! Top-scoring players on surviving teams will advance to the next round. Players who make it to the championship round will receive a Port of Mars T-shirt, and the winner of the championship will receive the top prize of \$500 USD! Winners of surviving groups in the first round will also receive a \$10 Amazon gift card."
npm run ${CLI_CMD} -- tournament treatment add --treatmentIds 1 2 3
npm run ${CLI_CMD} -- tournament round create --introSurveyUrl=https://asu.co1.qualtrics.com/jfe/form/SV_0c8tCMZkAUh4V8x --exitSurveyUrl=https://asu.co1.qualtrics.com/jfe/form/SV_6FNhPbsBuybTjEN --announcement="REGISTRATION FOR ROUND 1 IS NOW OPEN. Register, complete the Port of Mars Mission Control onboarding, and sign in during a scheduled launch time to compete in the next Mars Madness tournament!"
# set up 3 launch dates per day from 2024-02-08 to 2024-02-21
for day in {08..21}; do
npm run ${CLI_CMD} -- tournament round date --date="2024-02-${day}T17:00:00-07:00";
npm run ${CLI_CMD} -- tournament round date --date="2024-02-${day}T20:00:00-07:00";
npm run ${CLI_CMD} -- tournament round date --date="2024-02-${day}T22:00:00-07:00";
done
2 changes: 1 addition & 1 deletion server/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ async function createTournamentRoundDate(
): Promise<void> {
const sp = getServices(em);
if (date.getMinutes() !== 0) {
logger.fatal("Only dates on the hour are currently supported");
logger.fatal("Only dates on the hour are currently supported: %o", date);
return;
}
const scheduledDate = await sp.tournament.createScheduledRoundDate(date, tournamentRoundId);
Expand Down

0 comments on commit e8a45df

Please sign in to comment.