Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

click-odoo-update: add option to update all databases visible by odoo list_db() #39

Open
sbidoul opened this issue Feb 8, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@sbidoul
Copy link
Member

sbidoul commented Feb 8, 2019

No description provided.

@sbidoul sbidoul added the enhancement New feature or request label Feb 8, 2019
@gustavovalverde
Copy link

@sbidoul this might help (I think).

I use this approach in my actual CI/CD pipeline:

"[[ '$UPGRADE_ODOO' == '1' ]] \
 && odoo_db_list=$(psql -X -A -h ${DB_PORT_5432_TCP_ADDR} -p ${DB_PORT_5432_TCP_PORT} -U ${DB_ENV_POSTGRES_USER} -d postgres -t -c \"SELECT STRING_AGG(datname, ' ') FROM pg_database\") \
 && for db in ${odoo_db_list}; do click-odoo-update -d $db -c /etc/odoo/odoo.conf --log-level=warn \
 && echo 'The Database ${db} has been updated'; done || exit 0"

But Its actually way better to use the list_db() function from Odoo. I will try this myself and give you the feedback.

@gustavovalverde
Copy link

gustavovalverde commented Mar 28, 2020

@sbidoul it was easy to add the needed piece from the list_db() to my PSQL script, which resulted in:

odoo_db_list=$(psql -X -A -h ${DB_PORT_5432_TCP_ADDR} -p ${DB_PORT_5432_TCP_PORT} -U ${DB_ENV_POSTGRES_USER} -d postgres -t -c "SELECT STRING_AGG(datname, ' ') FROM pg_database WHERE datdba=(SELECT usesysid FROM pg_user WHERE usename=current_user) AND NOT datistemplate and datallowconn") && for db in ${odoo_db_list}; do click-odoo-update -d $db -c /etc/odoo/odoo.conf --log-level=info && echo "The Database ${db} has been updated"; done

This work perfectly for me; but ideally this has to remove databases resulting from list_db_incompatible()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants