Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 1 | --- |
| 2 | layout: documentation |
| 3 | title: Windows Chocolatey maintenance |
| 4 | --- |
| 5 | |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 6 | Maintaining Bazel Chocolatey package on Windows |
| 7 | =============================================== |
| 8 | |
Laszlo Csomor | ef4e78a | 2016-11-24 11:03:17 +0000 | [diff] [blame^] | 9 | **NOTE:** The Chocolatey package is experimental; please provide feedback |
| 10 | (`@petemounce` in issue tracker). |
| 11 | |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 12 | ### Prerequisites |
| 13 | |
| 14 | You need: |
Laszlo Csomor | ef4e78a | 2016-11-24 11:03:17 +0000 | [diff] [blame^] | 15 | |
| 16 | * [chocolatey package manager](https://chocolatey.org) installed |
| 17 | * (to publish) a chocolatey API key granting you permission to publish the |
| 18 | `bazel` package |
| 19 | * [@petemounce](https://github.com/petemounce) currently maintains this |
| 20 | unofficial package. |
| 21 | * (to publish) to have set up that API key for the chocolatey source locally |
| 22 | via `choco apikey -k <your key here> -s https://chocolatey.org/` |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 23 | |
| 24 | ### Build |
| 25 | |
| 26 | Compile bazel with msys2 shell and `compile.sh`. |
| 27 | |
| 28 | ```powershell |
| 29 | pushd scripts/packages/chocolatey |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame] | 30 | ./build.ps1 -version 0.3.2 -mode local |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 31 | popd |
| 32 | ``` |
| 33 | |
Laszlo Csomor | ef4e78a | 2016-11-24 11:03:17 +0000 | [diff] [blame^] | 34 | Should result in `scripts/packages/chocolatey/bazel.<version>.nupkg` being |
| 35 | created. |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 36 | |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame] | 37 | The `build.ps1` script supports `mode` values `local`, `rc` and `release`. |
| 38 | |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 39 | #### Test |
| 40 | |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame] | 41 | 0. Build the package (with `-mode local`) |
Laszlo Csomor | ef4e78a | 2016-11-24 11:03:17 +0000 | [diff] [blame^] | 42 | |
| 43 | * run a webserver (`python -m SimpleHTTPServer` in |
| 44 | `scripts/packages/chocolatey` is convenient and starts one on |
| 45 | `http://localhost:8000`) |
| 46 | |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 47 | 0. Test the install |
| 48 | |
Laszlo Csomor | ef4e78a | 2016-11-24 11:03:17 +0000 | [diff] [blame^] | 49 | The `test.ps1` should install the package cleanly (and error if it did not |
| 50 | install cleanly), then tell you what to do next. |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 51 | |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 52 | 0. Test the uninstall |
| 53 | |
Klaus Aehlig | c37fc16 | 2016-09-30 12:30:32 +0000 | [diff] [blame] | 54 | ```sh |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 55 | choco uninstall bazel |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame] | 56 | # should remove bazel from the system |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 57 | ``` |
| 58 | |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame] | 59 | Chocolatey's moderation process automates checks here as well. |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 60 | |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame] | 61 | ### Release |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 62 | |
Laszlo Csomor | ef4e78a | 2016-11-24 11:03:17 +0000 | [diff] [blame^] | 63 | Modify `tools/parameters.json` for the new release's URI and checksum once the |
| 64 | release has been published to github releases. |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame] | 65 | |
| 66 | ```powershell |
| 67 | ./build.ps1 -version <version> -isRelease |
| 68 | ./test.ps1 -version <version> |
| 69 | # if the test.ps1 passes |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 70 | choco push bazel.x.y.z.nupkg --source https://chocolatey.org/ |
| 71 | ``` |
| 72 | |
Laszlo Csomor | ef4e78a | 2016-11-24 11:03:17 +0000 | [diff] [blame^] | 73 | Chocolatey.org will then run automated checks and respond to the push via email |
| 74 | to the maintainers. |