depl icon indicating copy to clipboard operation
depl copied to clipboard

Order of deploy items should not matter

Open dbrgn opened this issue 11 years ago • 9 comments

When defining django before postgresql in depl.yml, things don't work. There should be a way to declare dependencies, so that the order of declaration doesn't matter.

dbrgn avatar Dec 17 '13 21:12 dbrgn

Oh, actually it's a different problem. When django auto-detects postgres, it wants to run the postgres deployment using the following settings:

{'user': None, 'password': None, 'id': 'auto_dectect_django_0', 'database': u'interna'}

The user and password are empty because my local database does not need authentication.

There should be a way to explicitly state the desired postgres configuration. And the Django deployment should be able to handle database configs without authentication config.

dbrgn avatar Dec 17 '13 21:12 dbrgn

The order of declaration matters. That might not be documented clearly but it does. Being inspired by travis-ci, you can do things like:

deploy:
    - sh: echo "before command"
    - django
    - sh: echo "after command"

However that bug obviously shouldn't happen. There is a way to explicitly specify postgresql users. I just don't understand how you configure your database if there's no user. What do you modify?

davidhalter avatar Dec 18 '13 14:12 davidhalter

There is a user, but I use peer authentication (http://www.postgresql.org/docs/9.1/static/auth-methods.html#AUTH-PEER) with local unix domain sockets for connection. So no username/password needed in the configuration.

dbrgn avatar Dec 18 '13 14:12 dbrgn

Hmm. That sounds good. But do you need to do something else than sudo apt-get install postgresql to enable that authentication?

davidhalter avatar Dec 18 '13 14:12 davidhalter

On some systems you need to edit pg_hba.conf. Not on Arch, but I think on Debian.

dbrgn avatar Dec 18 '13 16:12 dbrgn

There's even on Ubuntu machines a

local   all             all                                     peer

line in pg_hba.conf. But: What do we need to do additionally, if we create a database? It typically needs an owner, doesn't it?

davidhalter avatar Dec 19 '13 13:12 davidhalter

Yes, but if you just create a database using createdb, the owner is the currently logged in user. And if that's the same user that runs the Django app, no other configuration (e.g. username) is needed.

dbrgn avatar Dec 19 '13 14:12 dbrgn

All right. So basically that table would be owned by www-data, if you want to use defaults (deploying to /usr/www).

davidhalter avatar Dec 19 '13 16:12 davidhalter

Yes.

dbrgn avatar Dec 19 '13 17:12 dbrgn