- setup postgresql + citus + db test
docker run -d --name findeploydb -p 5432:5432 -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=admin -e POSTGRES_DB=findeploychat citusdata/citus:12.1
- check config db in
config.exs
,repo.ex
- create db with
mix ecto.create
- create citus MyApp.Repo.Citus inside
repo.ex
- execute sql
CREATE EXTENSION citus;
SELECT * from master_add_node('fin-worker-1', 5432);
SELECT * from master_add_node('fin-worker-2', 5432);
SELECT * FROM master_get_active_worker_nodes();
- write migrations files for repo and repo.citus
- check if
mix ecto.migrate
run successfully at local
- setup linux server to test citus
- setup postgresql on server
- download and setup citus follow docs
- setup edeliver + distillery + deploy on host and test with ecto repositories
- setup
prod.exs
same asdev.exs
- setup edeliver in .deliver/config with prod.exs
mix distillery.init
- test local with
mix distillery.release
, if error, fix - run on server with
mix edeliver build release --branch=main
- config if multi repo
- config in edeliver fork repo
- step to build with edeliver
- note:
- build release and deploy (need restart) =>
mix edeliver build release --branch=main && mix edeliver deploy release to production
- build release and deploy (need restart) =>
- build release and upgrade later