|
| 1 | +## CI/CD |
| 2 | + |
| 3 | +### Azure Project Setup |
| 4 | +All languages have their own project on Azure for CI/CD. Before setting up pipelines for keyboards and languages you will need to create that project. |
| 5 | + |
| 6 | +#### Initial project setup |
| 7 | +1. Go to [https://dev.azure.com/giellalt](https://dev.azure.com/giellalt) |
| 8 | +2. Click `Create project` and follow the instructions |
| 9 | + * Project name should be `<code>` |
| 10 | + * Write a description that contains the language name in readable format |
| 11 | + * Project should be public |
| 12 | + |
| 13 | +#### Connection to divvun-ci-config |
| 14 | +Since the keyboard and speller pipelines rely on the azure templates in the [divvun-ci-config](https://github.com/divvun/divvun-ci-config) repo you must create a service connection. |
| 15 | + |
| 16 | +1. Select the `<code>` project |
| 17 | +2. Go to `Project settings` |
| 18 | +3. Go to `Service connections` |
| 19 | +4. Select `New service connection` |
| 20 | +5. Select `GitHub` |
| 21 | +6. Make sure `Grant Access` is selected and name the connection `divvun-ci` |
| 22 | +7. `Allow all pipelines to use this connection` and select `Ok` |
| 23 | + |
| 24 | +### Setup Keyboard CI/CD |
| 25 | +Keyboard CI/CD is running on [Azure](https://dev.azure.com/giellalt) using templates for easier setup of new languages. The [template](https://github.com/divvun/divvun-ci-config/blob/master/repo/templates/keyboards.yml) will deploy: |
| 26 | +* Windows 8+ keyboard to Páhkat |
| 27 | +* macOS keyboard to Páhkat |
| 28 | +* iOS keyboard to App Store |
| 29 | +* Android keyboard to Google Play |
| 30 | + |
| 31 | +#### Speller archives |
| 32 | +The iOS and Android keyboard pipelines rely on the nightly speller archives of [https://apertium.projectjj.com](https://apertium.projectjj.com). |
| 33 | + |
| 34 | +#### Create repository |
| 35 | +Create a `giellalt` git repository named `keyboard-<code>` where code is the ISO 639-2 code of the language. |
| 36 | +* Add kbdgen configuration |
| 37 | + |
| 38 | +#### Páhkat packages |
| 39 | +The template requires windows and macOS to use separate Páhkat repositories, each with the following package set up on the `nightly` channel: |
| 40 | + |
| 41 | +* `keyboard-<code>` |
| 42 | + |
| 43 | +#### Azure pipelines configuration file |
| 44 | +Create a file named `azure-pipelines.yml` in the `keyboard-<code>` repository. Replace the values of the commented lines with values that apply to the new keyboard. |
| 45 | + |
| 46 | +```yaml |
| 47 | +trigger: |
| 48 | +- master |
| 49 | + |
| 50 | +resources: |
| 51 | + repositories: |
| 52 | + - repository: templates |
| 53 | + type: GitHub |
| 54 | + name: divvun/divvun-ci-config |
| 55 | + endpoint: divvun-ci |
| 56 | + |
| 57 | +jobs: |
| 58 | + - template: repo/templates/keyboards.yml@templates |
| 59 | + parameters: |
| 60 | + # the language code used when creating the lang-<code> repo |
| 61 | + name: crk |
| 62 | + # the name of the páhkat package |
| 63 | + packageName: keyboard-crk |
| 64 | + # the name of the folder in the keyboard-<code> repository that |
| 65 | + # contains the kbdgen configuration |
| 66 | + kbdgenFolder: "crk.kbdgen" |
| 67 | + # páhkat repository url for windows |
| 68 | + repositoryWin: "https://pahkat.uit.no/repo/windows" |
| 69 | + # páhkat repository url for macOS |
| 70 | + repositoryMac: "https://pahkat.uit.no/repo/macos" |
| 71 | + languages: |
| 72 | + # the folder part of the url to the zhfst bundle on projectjj |
| 73 | + # this example will expand to: |
| 74 | + # https://apertium.projectjj.com/apt/nightly/pool/main/g/giella-sma |
| 75 | + - projectjjName: giella-crk |
| 76 | + # the path of the zhfst in the bundle on projectjj |
| 77 | + path: usr/share/giella/mobilespellers/crk-mobile.zhfst |
| 78 | + # language code to use while bundling |
| 79 | + name: crk |
| 80 | +``` |
| 81 | +
|
| 82 | +#### Azure pipeline setup |
| 83 | +First make sure you have a project by following the instructions in the Azure Setup section. |
| 84 | +1. Select the `<code>` project |
| 85 | +2. Go to `Pipelines`, select `New pipeline` and follow the instructions |
| 86 | + * Connect to the `keyboard-<code>` repository on github |
| 87 | + * Use the `azure-pipelines.yml` configuration file from that repository |
| 88 | + |
| 89 | +#### Configure pipeline variables |
| 90 | +1. Select the keyboard build pipeline `giellalt.keyboard-<code>` |
| 91 | +2. Select `Edit` |
| 92 | +3. From the menu select `Variables` and configure the following variables |
| 93 | + |
| 94 | +| Name | Value | |
| 95 | +| ---------- | ------------------ | |
| 96 | +| android.version | The version of the keyboard as set in `targets/android.yml` | |
| 97 | +| divvunKey | The key used to decrypt the [divvun-ci-config](https://github.com/divvun/divvun-ci-config) repo | |
| 98 | +| ios.version | The version of the keyboard as set in `targets/ios.yml` | |
| 99 | +| pfxPassword | The password for the windows code sign pfx in the [divvun-ci-config](https://github.com/divvun/divvun-ci-config) repo | |
| 100 | +| svnUser | divvunci | |
| 101 | +| svnPassword | The password for the divvunci svn user | |
| 102 | +| svnCommit | Set to 1 to actually commit to svn, otherwise consider the pipeline to dry-run | |
| 103 | + |
| 104 | +##### Update this README |
| 105 | +* Add the new keyboard to the Keyboards table under Resources |
| 106 | +* Repository link should redirect to the repository on github |
| 107 | +* Add a CI report using the `Sample Markdown` found by clicking `Status badge` in the pipeline menu on Azure |
| 108 | + |
| 109 | +### Setup Language CI/CD |
| 110 | +Language CI/CD is running on [Azure](https://dev.azure.com/giellalt) using templates for easier setup of new languages. The [template](https://github.com/divvun/divvun-ci-config/blob/master/repo/templates/spellers.yml) will deploy: |
| 111 | +* System speller for windows 8+ and macOS |
| 112 | +* LibreOffice speller for windows and macOS |
| 113 | +* MSOffice speller for windows |
| 114 | + |
| 115 | +##### Speller archives |
| 116 | +The language pipelines rely on the nightly speller archives of [https://apertium.projectjj.com](https://apertium.projectjj.com). |
| 117 | + |
| 118 | +##### Create repository |
| 119 | +Create a `giellalt` git repository named `lang-<code>` where code is the ISO 639-2 code of the language. |
| 120 | +* Add a plain text file called `version.txt` containing the speller version |
| 121 | +* Add a license file called `LICENSE` |
| 122 | + |
| 123 | +##### Páhkat packages |
| 124 | +The template requires windows and macOS to use separate Páhkat repositories, with the following packages set up on the `nightly` channel: |
| 125 | + |
| 126 | +Windows |
| 127 | + |
| 128 | +* `speller-<code>` |
| 129 | +* `speller-<code>-lo` |
| 130 | +* `speller-<code>-mso` |
| 131 | + |
| 132 | +macOS |
| 133 | + |
| 134 | +* `speller-<code>` |
| 135 | +* `speller-<code>-lo` |
| 136 | + |
| 137 | +The package definition files `index.nightly.json` contains the UUIDs needed for the azure pipelines configuration. |
| 138 | + |
| 139 | +##### Azure pipelines configuration file |
| 140 | +Create a file named `azure-pipelines.yml` in the `lang-<code>` repository. Replace the values of the commented lines with values that apply to the new language. |
| 141 | + |
| 142 | +```yaml |
| 143 | +trigger: |
| 144 | +- master |
| 145 | +
|
| 146 | +resources: |
| 147 | + repositories: |
| 148 | + - repository: templates |
| 149 | + type: GitHub |
| 150 | + name: divvun/divvun-ci-config |
| 151 | + endpoint: divvun-ci |
| 152 | +
|
| 153 | +schedules: |
| 154 | +- cron: "3 0 * * *" |
| 155 | + displayName: Nightly build |
| 156 | + branches: |
| 157 | + include: |
| 158 | + - master |
| 159 | + always: true |
| 160 | +
|
| 161 | +jobs: |
| 162 | + - template: repo/templates/spellers.yml@templates |
| 163 | + parameters: |
| 164 | + # the language code used when creating the lang-<code> repo |
| 165 | + name: sma |
| 166 | + # páhkat repository url for windows |
| 167 | + repositoryWin: "https://pahkat.uit.no/repo/windows" |
| 168 | + # páhkat repository url for macOS |
| 169 | + repositoryMac: "https://pahkat.uit.no/repo/macos" |
| 170 | + # language name in readable format |
| 171 | + humanName: "Southern Sami Speller" |
| 172 | + # UUID used by páhkat for the windows windows system package |
| 173 | + uuidWin: '51852B34-FDAC-5748-B467-CF731D711EE0' |
| 174 | + # UUID used by páhkat for the windows libreoffice package |
| 175 | + uuidLO: '602CF630-93AE-47DB-AEB7-D18143F7D807' |
| 176 | + # UUID used by páhkat for the windows msoffice package |
| 177 | + uuidWinMso: '4F5DBECF-5760-487C-9CAB-62DAA3A86EAF' |
| 178 | + languages: |
| 179 | + # the folder part of the url to the zhfst bundle on projectjj |
| 180 | + # this example will expand to: |
| 181 | + # https://apertium.projectjj.com/apt/nightly/pool/main/g/giella-sma |
| 182 | + - projectjjName: giella-sma |
| 183 | + # the path of the zhfst in the bundle on projectjj |
| 184 | + path: usr/share/voikko/3/sma.zhfst |
| 185 | + # language code to use while bundling |
| 186 | + name: sma |
| 187 | +``` |
| 188 | + |
| 189 | +##### Azure pipeline setup |
| 190 | +1. Select the `<code>` project |
| 191 | +2. Go to `Pipelines`, select `New pipeline` and follow the instructions |
| 192 | + * Connect to the `lang-<code>` repository on github |
| 193 | + * Use the `azure-pipelines.yml` configuration file from that repository |
| 194 | + |
| 195 | +##### Configure pipeline variables |
| 196 | +1. Select the language build pipeline `giellalt.lang-<code>` |
| 197 | +2. Select `Edit` |
| 198 | +3. From the menu select `Variables` and configure the following variables |
| 199 | + |
| 200 | +| Name | Value | |
| 201 | +| ---------- | ------------------ | |
| 202 | +| divvunKey | The key used to decrypt the [divvun-ci-config](https://github.com/divvun/divvun-ci-config) repo | |
| 203 | +| pfxPassword | The password for the windows code sign pfx in the [divvun-ci-config](https://github.com/divvun/divvun-ci-config) repo | |
| 204 | +| svnUser | divvunci | |
| 205 | +| svnPassword | The password for the divvunci svn user | |
| 206 | +| svnCommit | Set to 1 to actually commit to svn, otherwise consider the pipeline to dry-run | |
| 207 | + |
| 208 | +##### Update this README |
| 209 | +* Add the new language to the Languages table under Resources |
| 210 | +* Repository link should redirect to the repository on github |
| 211 | +* Add a CI report using the `Sample Markdown` found by clicking `Status badge` in the pipeline menu on Azure |
0 commit comments