Upload mode
In this mode, the application updates the Rigi project with source files and downloads files with Rigi tokens.
Inhibit the upload when no changes are detected
The upload
command is typically used as a Git action. It is invoked automatically on specific commits to the code repository.
Infinite loops might happen when the upload returns files with Rigi tokens, and those files are then committed again.
The Rigi CLI tool prevents infinite loops by calculating a checksum over the source files listed in the manifest file and the content of the manifest file itself. When no changes are detected, the upload does not occur.
Parameters:
-url
Description: The URL of the project to which the files will be sent.
Requirements: The URL must contain the project ID (projects/{id}).
Example:
-url https://xyz.rigi.io/projects/35
.Required: Yes.
-repo
Description: The path to the repository (local working directory).
The path can be relative to the location where the tool is executed or an absolute path.
The manifest file uploaded to the Rigi workspace will contain relative paths with respect to this
-repo
folder.Example 32.If the
-repo
parameter isfolder1\folder2\folder3
and thefilepath
parameter isfolder1\folder2\folder3\folder4\folder5\myfile.json
, the resulting filepath in the Rigi workspace will becomefolder4\folder5\myfile.json
.Example:
-repo C:\repos\repo-project
.Required: Yes.
-targetfolder
Description: The path to the target folder in which processed files will be placed. If not specified, the default is the path provided in
-repo
.The path can be relative to the location where the tool is executed or an absolute path.
If the
-targetforlder
is not defined, the-repo
folder will be used as target folder.
Example:
-targetfolder C:\repos\repo\targets
.Required: No.
Default: The value of the
-repo
parameter.
-manifest
Description: The path to the manifest file, which contains metadata about the files.
The path to the manifest file can be relative to the location where the tool is executed or an absolute path.
The file paths provided in the manifest file also can be relative to the location of the manifest file or an absolute path.
Example:
-manifest C:\repos\repo-project\manifest.json
.Required: Yes.
Manifest format:
[ { "filepath": ".\\source\\shared\\common.resx", "fileId": "Common", "parserId": "resx", "targetRule": "TR_resx" }, { "filepath": ".\\source\\shared\\shared.resx", "fileId": "Shared", "parserId": "resx", "targetRule": "TR_resx" }, { "filepath": ".\\source\\modules\\module1.resx", "fileId": "Mod1", "parserId": "resx", "targetRule": "TR_resx" } ]
File paths in the manifest could be relative to the folder in which the manifest is placed or an absolute path.
-locales
Description: A comma-separated list of locale values that specify the target languages or regions for which xliff files must be downloaded.
Example:
-locales de,en,fr
.Required: No.
Default: None.
If the
xlifffolder
parameter is defined, locales must be defined too. Otherwise, xliff files for all target locales will be downloaded.-token
Important
This is the recommended authentication method.
If this parameter is present, both
-username
and-password
will be ignored.Important
Access tokens for the Rigi CLI tool must have the following authorizations:
Update project settings.
Upload to workspace.
Download from workspace.
Tokenize strings.
Upload translations.
Download translations.
For more details, see the Project settings – Access tokens section.
The
-token
parameter has two options:(Recommended) The file containing the access token for authentication (
-token-file
).Example:
-token token.txt
.Required: No.
The access token for authentication.
Example:
-token your-access-token
.Required: No.
-username
Description: The username for authentication. It will be ignored if the
-token
parameter is provided or the environment variableRIGICICD_USERNAME
is defined.Example:
-username jdoe@xyz.com
.Required: No.
-password
Description: The password for authentication. It will be ignored if the
-token
parameter is provided or the environment variableRIGICICD_PASSWORD
is defined.Example:
-password "Mygreatsecret%%"
.Required: No.
-tempfolder
Description: The path to the temporary folder used during the operation. If not specified, the app will create a temporary folder, and
-tempkeep
will always befalse
.The generated temporary folder will have the following name: rigi_{tenantname_rigi_io}_{projectid}.
Example:
-tempfolder C:\my_temp
.Required: No.
Default: A temporary folder created by the app.
-tempkeep
Description: Indicates whether to keep a copy of the ZIP file with the workspace and the manifest file that was uploaded to the server. It can be used for debugging purposes.
Required: No.
Default: If
-tempfolder
is not provided, the value isfalse
.
-xlifffolder
Description: Folder in which to extract xliff files. When it is not defined, xliff files will not be downloaded.
Example:
-xlifffolder C:\repos\repo\xliffs
.Required: No.
Checksum calculations parameters
Depending on the project, an upload operation can take a considerable amount of time. If nothing has changed in the manifest and source files, there is no need to trigger the upload to the server. The following actions are considered a change:
A file was added to the
manifest.json
.A property of one of the files listed in the
manifest.json
has changed (file ID, target rule ID, or parser ID).The content of one of the files has hanged.
The relative location within the workspace on the server has changed.
To avoid unnecessary uploads, the checksum calculations are applied:
Before the upload is executed, a checksum is calculated over the source files and the manifest file.
This checksum is compared against the checksum of the previous successful upload operation.
If the checksums are the same, the upload is not executed.
The checksum is stored locally.
By default, the system stores the checksum in a RigiCLI folder within the application data folder on your OS. You can override that folder using the -checksumfolder
argument.
You can also enforce the upload by using the -clearchecksum
argument. This setting will remove the checksum for the project before uploading.
To ignore the checksums, use the -nochecksum
argument.
-checksumfolder
Description: The path to the folder used to write the checksums of previous uploads. If it is not specified, the checksum will be stored in the application data subfolder rigiCLI.
Example:
-checksumfolder C:\somefolder\rigi-workspace-example\temp
.Required: No.
Default: A temporary folder created by the app.
-
-clearchecksum
Description: Clears the cached checksum information for this project. It will ensure that the source files are uploaded to the workspace.
Required: No.
Default: If
-clearchecksum
is not provided, the value isfalse
.
Only the checksum for this project will be removed from the cache. Checksums for other projects are not affected.
-nochecksum
Description: Use this parameter to ignore the checksum mechanism, for example, if there are any issues with storing checksums.
Required: No.
Default: If
-nochecksum
is not provided, the value isfalse
.
This parameter overrides the settings for
-checksumfolder
and-clearchecksum
.
Example Command
The Rigi CLI tool is not part of the repository. In the following example, we assume it is located in the folder C:\rigiSDK
.
dotnet Rigi-CLI.dll upload -url https://xyz.rigi.io/projects/35 -repo ..\repos\repo-project\ -manifest ..\repos\repo-project\manifest.json -locales de -username jdoe@xyz.com -password "xxxxxxxx" -tempfolder ../Temp -tempkeep
If the
-token
parameter is used, the-username
and-password
parameters will be ignored.If the
-tempfolder
parameter is not specified, a default temporary folder created by the app will be used, and the-tempkeep
parameter will be set tofalse
.