Create .github/workflows/init-odoo-db.yml
Browse files
.github/workflows/init-odoo-db.yml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Initialize Odoo Database
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
workflow_dispatch: # run manually from GitHub Actions tab
|
| 5 |
+
|
| 6 |
+
jobs:
|
| 7 |
+
init-db:
|
| 8 |
+
runs-on: ubuntu-latest
|
| 9 |
+
timeout-minutes: 360 # 6 hour max
|
| 10 |
+
|
| 11 |
+
steps:
|
| 12 |
+
- name: Pull Odoo image
|
| 13 |
+
run: docker pull odoo:19.0
|
| 14 |
+
|
| 15 |
+
- name: Initialize Odoo DB on Supabase
|
| 16 |
+
run: |
|
| 17 |
+
docker run --rm \
|
| 18 |
+
odoo:19.0 odoo \
|
| 19 |
+
--db_host=aws-1-ap-northeast-1.pooler.supabase.com \
|
| 20 |
+
--db_port=6543 \
|
| 21 |
+
--db_user=postgres.osuzlevppycklgjmhygx \
|
| 22 |
+
--db_password=${{ secrets.DB_PASSWORD }} \
|
| 23 |
+
--db_name=postgres \
|
| 24 |
+
--db_sslmode=require \
|
| 25 |
+
-i base \
|
| 26 |
+
--stop-after-init \
|
| 27 |
+
--no-http \
|
| 28 |
+
--log-level=info
|
| 29 |
+
timeout-minutes: 120
|
| 30 |
+
|
| 31 |
+
- name: Verify DB initialized
|
| 32 |
+
run: |
|
| 33 |
+
sudo apt-get install -y postgresql-client
|
| 34 |
+
PGPASSWORD=${{ secrets.DB_PASSWORD }} psql \
|
| 35 |
+
"postgresql://postgres.osuzlevppycklgjmhygx:${{ secrets.DB_PASSWORD }}@aws-1-ap-northeast-1.pooler.supabase.com:6543/postgres?sslmode=require" \
|
| 36 |
+
-c "SELECT COUNT(*) FROM ir_module_module;"
|