Tip
For information about GitLab integration in Phrase TMS, refer to GitLab (TMS).
Prerequisites
-
The
.phrase.ymlconfiguration file must be present in the root of the branch to be monitored. The file defines which files to import (pull) or export (push) from the repository. -
Read and write access are required for the repository.
-
Incorrectly defined configuration files may cause errors. Ensure that the file contains at least one push and one pull target, correct file formats and the correct setting of the
update_translationsparameter. -
Use GitLab 9.5 or newer to ensure API compatibility.
Once the configuration file is in place, to connect a repository, follow these steps:
-
In the main navigation, click Automations, then Repo Syncs.
Alternatively, from the page, scroll down to and click Configure.
The page opens. The list displays only projects the viewing user has access to.
-
Click Add Sync/GitLab.
The settings window opens.
-
Select a project from the dropdown list.
-
Optionally select and provide the GitLab self-hosted .
-
Select a from the dropdown list.
-
Select a from the dropdown list to import (push) and export (pull) from. This is usually the master branch.
-
Click Validate Configuration to ensure access token and configuration file are correct.
-
Optionally select to import files with every commit to the selected GitLab branch.
Provide a for the webhook and the copied from Strings.
-
Optionally select the of the repo sync. The owner defaults to the account owner and must be an active member of the account with access to the project.
Automated actions, such as automatic exports and imports, run on behalf of the owner. Manual imports and exports use the current user.
-
Optionally select one or more to export automatically. If is selected, set the frequency, time, days of the week or day of the month, and time zone.
-
Click Save.
The project is now connected to the selected GitLab repository and added to the list.
-
(Optional) Click the pencil icon to rename the integration.
To import files:
-
From the page, select a project and click Import
.
GitLab data is imported into the selected project.
To export files, follow these steps:
-
From the page, select a project and click Export
.
The window is displayed.
-
Provide the target branch in the field.
The most recent files in the repository will be exported as a new pull request to the desired branch.
-
Once files are exported, the pull request can be merged or closed in the repository and the branch can be deleted.
Note
In case of issues upon importing or exporting, use the CLI client to test the .phrase.yml configuration file locally and check for any error messages.
If required, contact Phrase Technical Support and attach the .phrase.yml configuration file to the support request.
A repo sync can export automatically. Select one or more of the following triggers:
-
: the export runs on a recurring schedule.
-
: the export runs when a branch of the project is merged.
-
: the export runs when a job in the project is completed.
Triggers can be combined, changed, or removed at any time. Automatic exports run only while the repo sync is active.
If several merges or job completions occur within a short time, only one export runs.
Note
When zero-touch localization is enabled for the project, the trigger does not fire.
Repo syncs keep a history of the latest imports and exports for each Phrase Strings project.
To view the history: