Skip to content

Commit

Permalink
Fix transifex push and pull database
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed Jun 27, 2023
1 parent c6b312e commit 7cb0383
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .env.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
AWS_BUCKET_NAME=${AWS_BUCKET_NAME}
ANALYTICS=${ANALYTICS}
BROKER_URL=${BROKER_URL}
TX_USR=${TX_USR}
TX_PWD=${TX_PWD}
TX_TOKEN=${TX_TOKEN}
HTPASSWORDS=${HTPASSWORDS}
6 changes: 6 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ type = PO
source_file = /tmp/thinkhazard-database.pot
source_lang = en
file_filter = /tmp/thinkhazard-database-<lang>.po

[o:gfdrr-labs:p:gfdrr-thinkhazard:r:test--database]
type = PO
source_file = /tmp/thinkhazard-database.pot
source_lang = en
file_filter = /tmp/thinkhazard-database-<lang>.po
3 changes: 1 addition & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ services:
- hazardsets:/tmp/hazardsets
environment: &env
- INI_FILE
- TX_USR
- TX_PWD
- TX_TOKEN
- PGHOST
- PGPORT
- PGUSER_PUBLIC
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SQLAlchemy<2
alembic
asyncio
boto3
chameleon # needed by lingua
colorlog
geoalchemy2
gunicorn
Expand Down
6 changes: 2 additions & 4 deletions thinkhazard/scripts/tx-init
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

cat <<EOF > ${HOME}/.transifexrc
[https://www.transifex.com]
hostname = https://www.transifex.com
username = ${TX_USR}
password = ${TX_PWD}
token =
rest_hostname = https://rest.api.transifex.com
token = ${TX_TOKEN}
EOF
4 changes: 2 additions & 2 deletions thinkhazard/scripts/tx-pull-db
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#!/bin/bash -e

$(dirname $0)/tx-init

tx pull -s -r gfdrr-thinkhazard.database ${TX_BRANCH:+-b "$TX_BRANCH"}
tx pull --translations --languages=es,fr --resources=gfdrr-thinkhazard.database --force

import_l10n -v
4 changes: 2 additions & 2 deletions thinkhazard/scripts/tx-push-db
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#!/bin/bash -e

$(dirname $0)/tx-init

pot-create -c lingua.cfg -o /tmp/thinkhazard-database.pot thinkhazard/dont_remove_me.db-i18n

tx push -s -r gfdrr-thinkhazard.database ${TX_BRANCH:+-b "$TX_BRANCH"}
tx push --source --resources=gfdrr-thinkhazard.database

0 comments on commit 7cb0383

Please sign in to comment.