Skip to content

Commit

Permalink
[Parvathy, Rahul] | BAH-3002 | Add. Script To Push Translations to Tr…
Browse files Browse the repository at this point in the history
…ansifex

Co-authored-by: Parvathy Babu <parvathy.babu@thoughtworks.com>
  • Loading branch information
rahu1ramesh and parvathy00 committed Sep 19, 2023
1 parent fd1454a commit 59e3f1f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/scripts/transifex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

function command_exists() {
command -v "$1" >/dev/null 2>&1
}

if ! command_exists tx; then
echo "Transifex CLI is not installed. Installing..."
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
mv tx /usr/local/bin/tx
fi

if [ ! -f .tx/config ]; then
echo "Transifex config file (.tx/config) not found in the repository."
exit 1
fi

echo "Pushing translation source file to Transifex..."
tx push -s

if [ $? -ne 0 ]; then
echo "Error: Transifex push failed. Please check the error message above."
exit 1
else
echo "Translation source file successfully pushed to Transifex."
fi
5 changes: 5 additions & 0 deletions .github/workflows/build_publish_openelis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,8 @@ jobs:
file: package/docker/openelis/Dockerfile
push: true
tags: bahmni/openelis:${{env.ARTIFACT_VERSION}},bahmni/openelis:latest
- name: Push Translations to Transifex
run: |
bash .github/scripts/transifex.sh
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}

0 comments on commit 59e3f1f

Please sign in to comment.