A serverless application that integrates Transifex with Github like Transifex Txgh.
-
When a resource of Transifex is all translated,
- Create feature branch for translation per the Transifex resource.
- Create git commit for the translation from Transifex translation contents. In addition, the user email of the translator in Transifex is used for git commit author (for PO files only currently).
- Create pull request from the feature branch to specified target branch.
-
When the resource of Transifex is all reviewed,
- Add git commit the reviewed translation to the feature branch.
-
Install modules via npm:
npm install
-
Set-up your aws account:
export AWS_ACCESS_KEY_ID=... export AWS_SECRET_ACCESS_KEY=...
-
Set-up txgh-serverless config via environment variables:
export SLS_GH_REPO="your-name/your-repository-name"; export SLS_GH_BASE_BRANCH="develop"; export SLS_GH_COMMITER_USERNAME="translator"; export SLS_GH_COMMITER_EMAIL="translator@example.org"; export SLS_GH_COMMITER_TOKEN="..."; export SLS_TX_ORG="your-transifex-org-name"; export SLS_TX_PROJECT="your-transifex-project"; export SLS_TX_SECRET="your-secret-of-transifex-webhook"; export SLS_TX_CREDENTIAL="api:your-transifex-api-token" export SLS_SITE_URL="http://your-document-site.org/<branch>/<lang>/index.html"
-
Deploy!
$ ./node_modules/.bin/serverless deploy --stage production Serverless: Packaging service... Serverless: Excluding development dependencies... Serverless: Uploading CloudFormation file to S3... Serverless: Uploading artifacts... Serverless: Uploading service .zip file to S3 (3.83 MB)... Serverless: Validating template... Serverless: Updating Stack... Serverless: Checking Stack update progress... .................... Serverless: Stack update finished... Service Information service: txgh-serverless stage: production region: us-east-1 stack: txgh-serverless-production api keys: None endpoints: POST - https://**********.execute-api.us-east-1.amazonaws.com/production/transifex POST - https://**********.execute-api.us-east-1.amazonaws.com/production/github functions: transifex: txgh-serverless-production-transifex github: txgh-serverless-production-github
You can use above endpoint URL as webhook for transifex.