-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb892fb
commit 0c2a8b8
Showing
4 changed files
with
50 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,76 @@ | ||
# Changelog Script | ||
# SDK Copy Management | ||
|
||
Changelog script helps projects to generate changelogs and update their markdown files during release process. | ||
This repo helps projects to integrate with SDK copy management tool (currently Lokalise). | ||
|
||
- [Getting started](#getting-started) | ||
- [Pre-requisites](#pre-requisites) | ||
- [Tools](#tools) | ||
- [Generating Changelog Entry](#generating-changelog-entry) | ||
- [Updating Changelog Files](#updating-changelog-files) | ||
- [Retrieving Released Changelogs](#retrieving-released-changelogs) | ||
- [Fetching Strings](#fetching-strings) | ||
- [Checking Strings](#checking-strings) | ||
|
||
## Getting started | ||
|
||
This section will contain the necessary instructions to enable you to run the project. | ||
|
||
### Pre-requisites | ||
|
||
Before starting changelog script you should update your project structure with creating changelogs/ folder under your project root. | ||
|
||
#### Tools | ||
|
||
- Ruby must be installed in system where you run changelog scripts. Suggested version is 2.6.x. | ||
- Ruby must be installed in system where you run scripts. Suggested version is 2.6.x. | ||
- Run `gem install bundler` to install ruby dependency manager | ||
- Run `bundle install` to install necessary ruby packages | ||
|
||
## Generating Changelog Entry | ||
## Fetching Strings | ||
|
||
When you start to work on new ticket, most probably you will want to create changelog entry for it. Rather than updating your CHANGELOG.Md file, you should run this script. Basically this script: | ||
- Copies sample changelog entry from this repository to {YOUR_PROJECT_PATH}/changelogs/unreleased folder. | ||
- It also checks your current git branch name. if there is any CX-XXXX pattern in the branch name, script renames json file same as your current branch name. | ||
When copies are updated on lokalise, at some point SDK projects will have to adopt those changes. Rather than moving copy changes manually from lokalise to the project, this script helps you to fetch changes in one go. | ||
|
||
Example script usage: | ||
So this script: | ||
|
||
```shell | ||
$ ./bin/create_changelog_entry.rb --project-path '/Users/admin/Desktop/dev/repo/onfido-ios-sdk' | ||
``` | ||
### Parameters | ||
|
||
| Paremeter Name | Required | Description | | ||
|--------------------------------|---------------|----------------------------------| | ||
| project-path | YES | Root path of your project | | ||
|
||
**Note**: --project-path parameter is required | ||
|
||
## Updating Changelog Files | ||
|
||
During release process, you may want to update your changelog or migration files based on the changelog entries generated until that time. This script allows you to update your internal/public changelog and migration files to be updated. | ||
- Finds string changes with the given tag. | ||
- Retrieves those changes and applies changes to string files of the project. | ||
|
||
Example script usage: | ||
|
||
```shell | ||
$ ./bin/update_changelog_files.rb --project-path '/Users/admin/Desktop/dev/repo/onfido-ios-sdk' \ | ||
--sdk-version '18.0.0' \ | ||
--platform 'ios' \ | ||
--internal-changelog-file-path 'CHANGELOG-INTERNAL.md' \ | ||
--public-changelog-file-path 'documentation/CHANGELOG.md' \ | ||
--migration-file-path 'documentation/MIGRATION.md' | ||
$ ./bin/fetch-strings.rb --tag 'CX-5433 NFC UI' \ | ||
--platform ios \ | ||
--project-path /Users/kerem.gunduz/Desktop/dev/repo/onfido-ios-sdk \ | ||
--lokalise-project-id YYY \ | ||
--lokalise-token XXX | ||
``` | ||
|
||
### Parameters | ||
|
||
| Paremeter Name | Required | Description | | ||
|--------------------------------|---------------|----------------------------------| | ||
| project-path | YES | Root path of your project | ||
| sdk-version | YES| New SDK version you're about to release | | ||
|platform | YES | Can be either `ios`, `android` or `js` | | ||
| internal-changelog-file-path | NO | Relative path of internal changelog file, don't pass this parameter if you don't use internal change log in your project | | ||
| public-changelog-file-path | YES | Relative path of public changelog file | | ||
| migration-file-path | NO | Relative path of migration file, don't pass this parameter if you don't use migration document or you want to manage it on your own | | ||
| tag | YES | Tag name you want to use on lokalise to fetch updates | | ||
| platform | YES | Platform value, can be either ios or android | | ||
| project-path | YES | Root path of your project | | ||
| lokalise-project-id | YES | Lokalise project id value, can be retrieved from https://app.lokalise.com/ | | ||
| lokalise-token | YES | Lokalise token value, can be retrieved from https://app.lokalise.com/ | | ||
|
||
## Retrieving Released Changelogs | ||
## Checking Strings | ||
|
||
At any time, you may want to retrieve released changelogs. This script prints you to know what changes has been done for given version. | ||
This script helps you to understand whether strings on lokalise and project are consistent. It checks missing, extra strings along with mismatched translations. | ||
|
||
Example script usage: | ||
|
||
```shell | ||
$ ./bin/retrieve_released_changelogs.rb --project-path '/Users/admin/Desktop/dev/repo/onfido-ios-sdk' \ | ||
--sdk-version '18.0.0' \ | ||
--public-only | ||
$ ./bin/check-strings.rb --lang en_US \ | ||
--platform android \ | ||
--branch new_auto_capture_alert \ | ||
--project-path /Users/kerem.gunduz/Desktop/dev/repo/android-capture-sdk/onfido-capture-sdk-core/src/main/res \ | ||
--lokalise-project-id XXX \ | ||
--lokalise-token YYY | ||
``` | ||
|
||
### Parameters | ||
|
||
| Paremeter Name | Required | Description | | ||
|--------------------------------|---------------|----------------------------------| | ||
| project-path | YES | Root path of your project | ||
| sdk-version | YES| SDK version you want to get information | | ||
| public-only | NO | Indicates that you want to get only `public` changelog entries. Don't pass it if you want to get all changes| | ||
|
||
| Paremeter Name | Required | Description | | ||
|----------------|-------------------|----------------------------------| | ||
| project-path | YES | Root path of your project | | ||
| platform | YES | Platform value, can be either ios or android | | ||
| lang | YES | Language code | | ||
| branch | YES | Lokalise branch name | | ||
| lokalise-project-id | YES | Lokalise project id value, can be retrieved from https://app.lokalise.com/ | | ||
| lokalise-token | YES | Lokalise token value, can be retrieved from https://app.lokalise.com/ | | ||
|
||
**Hint**: You can run scripts with `-h` option to get more detailed usage explanation. | ||
**Hint**: You can create bash or ruby script wrappers to prevent sending same parameters over and over again. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters