blob: ee712824a722eb08405821798a8f8d03eea2e6e1 [file] [log] [blame] [view]
Peter Mouncea27949e2016-09-26 15:58:53 +00001---
2layout: documentation
3title: Windows Chocolatey maintenance
4---
5
Peter Mouncea27949e2016-09-26 15:58:53 +00006Maintaining Bazel Chocolatey package on Windows
7===============================================
8
Laszlo Csomoref4e78a2016-11-24 11:03:17 +00009**NOTE:** The Chocolatey package is experimental; please provide feedback
10(`@petemounce` in issue tracker).
11
Peter Mouncea27949e2016-09-26 15:58:53 +000012### Prerequisites
13
14You need:
Laszlo Csomoref4e78a2016-11-24 11:03:17 +000015
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 Mouncea27949e2016-09-26 15:58:53 +000023
24### Build
25
26Compile bazel with msys2 shell and `compile.sh`.
27
28```powershell
29pushd scripts/packages/chocolatey
Peter Mouncef9fa89f2016-11-03 10:26:29 +000030 ./build.ps1 -version 0.3.2 -mode local
Peter Mouncea27949e2016-09-26 15:58:53 +000031popd
32```
33
Laszlo Csomoref4e78a2016-11-24 11:03:17 +000034Should result in `scripts/packages/chocolatey/bazel.<version>.nupkg` being
35created.
Peter Mouncea27949e2016-09-26 15:58:53 +000036
Peter Mouncef9fa89f2016-11-03 10:26:29 +000037The `build.ps1` script supports `mode` values `local`, `rc` and `release`.
38
Peter Mouncea27949e2016-09-26 15:58:53 +000039#### Test
40
Peter Mouncef9fa89f2016-11-03 10:26:29 +0000410. Build the package (with `-mode local`)
Laszlo Csomoref4e78a2016-11-24 11:03:17 +000042
43 * run a webserver (`python -m SimpleHTTPServer` in
44 `scripts/packages/chocolatey` is convenient and starts one on
45 `http://localhost:8000`)
46
Peter Mouncea27949e2016-09-26 15:58:53 +0000470. Test the install
48
Laszlo Csomoref4e78a2016-11-24 11:03:17 +000049 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 Mouncea27949e2016-09-26 15:58:53 +000051
Peter Mouncea27949e2016-09-26 15:58:53 +0000520. Test the uninstall
53
Klaus Aehligc37fc162016-09-30 12:30:32 +000054 ```sh
Peter Mouncea27949e2016-09-26 15:58:53 +000055 choco uninstall bazel
Peter Mouncef9fa89f2016-11-03 10:26:29 +000056 # should remove bazel from the system
Peter Mouncea27949e2016-09-26 15:58:53 +000057 ```
58
Peter Mouncef9fa89f2016-11-03 10:26:29 +000059Chocolatey's moderation process automates checks here as well.
Peter Mouncea27949e2016-09-26 15:58:53 +000060
Peter Mouncef9fa89f2016-11-03 10:26:29 +000061### Release
Peter Mouncea27949e2016-09-26 15:58:53 +000062
Laszlo Csomoref4e78a2016-11-24 11:03:17 +000063Modify `tools/parameters.json` for the new release's URI and checksum once the
64release has been published to github releases.
Peter Mouncef9fa89f2016-11-03 10:26:29 +000065
66```powershell
67./build.ps1 -version <version> -isRelease
68./test.ps1 -version <version>
69# if the test.ps1 passes
Peter Mouncea27949e2016-09-26 15:58:53 +000070choco push bazel.x.y.z.nupkg --source https://chocolatey.org/
71```
72
Laszlo Csomoref4e78a2016-11-24 11:03:17 +000073Chocolatey.org will then run automated checks and respond to the push via email
74to the maintainers.