Skip to content

manage database from erlang shipment #51

@ToddG

Description

@ToddG

CONTEXT

I have 3 hosts: [build, web, db]

On build, I build the gleam web app:

gleam export erlang-shipment

I tar the shipment up and extract it into web.

In web, I want to run my database migration scripts to update my database in db host.

ERROR

On web hos:

# cd to the directory with the entrypoint.sh
cd $APP_DIR
 
# show what's here
[root@web] # ls $APP_NAME/
ebin    include priv

# we have all the db migrations:
[root@web]# ls $APP_NAME/priv/migrations/
20250101010101-foo-01.sql
...

# cigogne fails to run b/c it cannot find the gleam.toml file
[root@web]# gleam run -m cigogne up
error: Project not found

We were unable to find gleam.toml.

We searched in /opt/file/app/gws and all parent directories.

DISCUSSION

I'd like to use cigogne from the deployed app rather than from the source code because:

  1. I use ansible for my infrastructure as code (IAC) and with this I can automate my database management across my server fleet
  2. For reasons, I don't want to push my source code to my web or db hosts
  3. For reasons, I don't want to install sshd or open ssh ports on my web or db hosts

I have a firewall and postgresql pg_hba.conf rules that only allow traffic from the web host to the db host. So I'd like all db management to originate from the web host, but without the application source code installed.

I'll try to sort out work-arounds to unblock my work... for starters I'll temporarily bring in the source code and see if I can get cigogne to work with that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions