Manual Deployment

Why

There are certain files deployed in analytics that have a different release cadence to the main application. This document outlines how files can be manually pushed to lokalise and deployed to production.

1. Configure your AWS CLI environment

Working with Lokalise requires access to the following SSM parameters:

/platform/accent/lokalise/LOKALISE_PROJECT_ID
/platform/accent/lokalise/LOKALISE_TOKEN_WRITE

Follow this guide to configure your AWS CLI and gain access to these parameters.

2. To manually upload files to a lokalise environment

Execute the following script (where <path_to_yml> is a comma-seperated list of filenames to send):

docker run \
  -v /tmp/locale:/opt/dest \
  lokalise/lokalise-cli-2 lokalise2 \
  --token ${LOKALISE_TOKEN_WRITE} \
  --project-id ${LOKALISE_PROJECT_ID} \
  file upload \
  --file <path_to_yml> \
  --lang-iso en
  --convert-placeholders=true
  --detect-icu-plurals=true

Lokalise will automatically translate and deploy your keys to the dev S3 bucket.

3. Manually deploy development files to prod

Call the following webhook:

https://gitlab.com/api/v4/projects/PROJECT/ref/master/trigger/pipeline?token=TOKEN&variables[TASK_TYPE]=export_s3_dev_to_s3_prod&variables[FILES]=PATTERN

Where:

  • TOKEN can be found in the localisation repository CI settings under Pipeline triggers.
  • PATTERN should be a valid S3 include pattern for json files.
    This is recursive and supports wildcards, but you will need to include the folder & filename as per the following examples:
    • To deploy a specific file across all languages: */sampleOne.json
    • To deploy a specific file but only for a specific language: en-US/sampleTwo.json
    • To deploy all files that start with a specific string: */sample*.json
  • PROJECT is the numeric ID of the localisation repository

This can also be executed with a call to the API.