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 <[email protected]>
  • Loading branch information
rahu1ramesh and parvathy00 committed Sep 20, 2023
1 parent 5743936 commit 3359332
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
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
6 changes: 5 additions & 1 deletion .github/workflows/build_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: bahmni/default-config:${{env.ARTIFACT_VERSION}},bahmni/default-config:latest

- name: Push Translations to Transifex
run: |
bash .github/scripts/transifex.sh
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Update Version and Image Tag
run: |
yq --inplace '.image.tag = "${{ env.ARTIFACT_VERSION }}"' $HELM_CHART_PATH/values.yaml
Expand Down

0 comments on commit 3359332

Please sign in to comment.