[x] Make a GitHub action that will create a Docker image and push to my container registry (see this).
[x] Put the tokens.json file on the machine.
[x] Run the migration file on the mini PC.
[x] Something needs to know to run this when I push a new image. It should be part of Abbott when run with a certain argument. Keep in mind that Watchtower is going to boot up a new image no matter what, even if the schemas don't match. Make sure to back up if there is a new migration to run.
[x] Use Watchtower or Caprover to pull the image from the mini PC whenever a new one exists. It should also run it.
[x] octorin_: Just so you know, later when you setup your docker-compose.yml and reference the build file for the bot service you can just do docker-compose build
[x] Make sure I'm automatically specifying the .env file in either the compose file or the Ansible docker-compose up command.
[x] Get rid of tokens.json
Make a new schema entirely that is separate from back-ups? This may be good to do eventually, but I don't know that I want to invest in that just yet (especially since it's just my token at first).
Check for tokens in the database (need to make a new table)
If they're not there, try pulling them from the environment
Add the tokens to .env.example
When a token is refreshed, save it to the database with the proper updated_at time
After doing this, copy my env file to the mini PC. Also, it should be .env.production.
Make sure to write any manual setup in all relevant instructions
[x] Clean-up
[x] Do I want to rename get-tokens to something more descriptive? Like init-twitch-token?
[x] Make sure we run migrations from the dist folder since we don't have the src folder in the Docker image. This is only possible after fixing the tokens issue since that's stopping us from getting further.
[x] Remember that if there's anything private in the database, I need to be careful about dumping tables and I can't look at backups on-stream anymore. I also shouldn't run docker inspect on production containers (it spews the environment).
[x] Delete the tokens.json file (and remove it from gitignore?)
[x] Copy the database over to the mini PC.
[x] Figure out how I'm going to develop from my Mac and not have to do this all the time. I could just point my Mac at the mini PC's database, but that's probably a bad idea. I should start looking at the mini PC as being the "production" database, so I guess that means testing in a totally different channel when I'm developing.
[x] Make sure the mini PC has any environment variables that it needs. Maybe just copy over an .env file? I could store this in the Ansible vault. It may just be easier to copy/paste the file from my own machine so that I don't need to store anything new.
[x] Jumumu: Yeah you can just create a compose file and then create a super-secret.env and run: docker-compose --env-file /path/to/super-secret.env up -d (could also do it right in the Compose file (reference))
Tasks that don't need to be done:
Probably just make a new repo entirely for this. I don't think it makes sense to mix the entirety of the mini PC's tasks with just the Abbott tasks (e.g. I also want it to do some Raspberry Pi stuff). Note that I could just have two different Ansible playbooks—an Abbott-specific one and a personal one.
Rationale: I think that when it comes to merging what was done from the RPi that I should make a new repo then.
.env
file (reference).Tasks:
Dockerfile
tokens.json
file on the machine.docker-compose build
.env
file in either the compose file or the Ansibledocker-compose up
command.updated_at
timeget-tokens
to something more descriptive? Likeinit-twitch-token
?dist
folder since we don't have thesrc
folder in the Docker image. This is only possible after fixing the tokens issue since that's stopping us from getting further.docker inspect
on production containers (it spews the environment)..env
file? I could store this in the Ansible vault. It may just be easier to copy/paste the file from my own machine so that I don't need to store anything new.Jumumu: Yeah you can just create a compose file and then create a super-secret.env and run: docker-compose --env-file /path/to/super-secret.env up -d
(could also do it right in the Compose file (reference))Tasks that don't need to be done: