A quick application of AWS Copilot to sync Lichess and Beeminder.
- Install AWS CLI and set it up with your credentials.
- Install Docker Desktop.
- Install AWS Copilot.
brew install aws/tap/copilot-cli
Create the application and environment (high-level logical grouping) that your jobs will live in. This will take a couple of minutes.
copilot app init cloud
copilot env init --name cron --profile default --default-config
Populate secrets for the app. Run the following commands:
copilot secret init --name BEEMINDER_USERNAME
copilot secret init --name BEEMINDER_API_TOKEN
copilot secret init --name LICHESS_USERNAME
You'll be prompted to enter the values of each of these secrets. Paste them into the terminal and hit enter each time.
Modify local manifest if necessary. If your goal name is not "chess," You'll need to change the goal name in the variables
section to whatever your Beeminder goal's name is.
Initialize and deploy the job. This command will run the job at the 55th minute of every hour. You can modify the schedule by changing the schedule
field in the generated manifest at copilot/beeminder-chess/manifest.yml
.
copilot init \
--name beeminder \
--type Scheduled\ Job \
--dockerfile Dockerfile \
--schedule "55 * * * *" \
--retries 2
copilot deploy
This should't be expensive. The only resources you'll incur a charge for are the containers themselves, and they're billed by the second at about $7.50/month. The total charge for the ECR docker image storage + execution costs should be about 5 cents per month.