blob: 90c92007f81ca5f746a5fa22c4d78e91dd2d8f42 [file] [log] [blame] [view]
Peter Mouncea27949e2016-09-26 15:58:53 +00001---
2layout: documentation
3title: Windows Chocolatey maintenance
4---
5
6Installing Bazel on Windows
7===========================
8
9You can install the unofficial package using the [chocolatey](https://chocolatey.org) package manager:
10
Klaus Aehligc37fc162016-09-30 12:30:32 +000011```sh
Peter Mouncea27949e2016-09-26 15:58:53 +000012choco install bazel
13```
14
15This will install the latest available version of bazel, and dependencies.
16
17This package is experimental; please provide feedback (`@petemounce` in issue tracker).
18
19
20Maintaining Bazel Chocolatey package on Windows
21===============================================
22
23### Prerequisites
24
25You need:
26* [chocolatey package manager](https://chocolatey.org) installed
27* (to publish) a chocolatey API key granting you permission to publish the `bazel` package
28 * [@petemounce](https://github.com/petemounce) currently maintains this unofficial package.
29* (to publish) to have set up that API key for the chocolatey source locally via `choco apikey -k <your key here> -s https://chocolatey.org/`
30
31### Build
32
33Compile bazel with msys2 shell and `compile.sh`.
34
35```powershell
36pushd scripts/packages/chocolatey
Peter Mouncef9fa89f2016-11-03 10:26:29 +000037 ./build.ps1 -version 0.3.2 -mode local
Peter Mouncea27949e2016-09-26 15:58:53 +000038popd
39```
40
41Should result in `scripts/packages/chocolatey/bazel.<version>.nupkg` being created.
42
Peter Mouncef9fa89f2016-11-03 10:26:29 +000043The `build.ps1` script supports `mode` values `local`, `rc` and `release`.
44
Peter Mouncea27949e2016-09-26 15:58:53 +000045#### Test
46
Peter Mouncef9fa89f2016-11-03 10:26:29 +0000470. Build the package (with `-mode local`)
Peter Mouncea27949e2016-09-26 15:58:53 +000048 * run a webserver (`python -m SimpleHTTPServer` in `scripts/packages/chocolatey` is convenient and starts one on `http://localhost:8000`)
Peter Mouncea27949e2016-09-26 15:58:53 +0000490. Test the install
50
51 The `test.ps1` should install the package cleanly (and error if it did not install cleanly), then tell you what to do next.
52
Peter Mouncea27949e2016-09-26 15:58:53 +0000530. Test the uninstall
54
Klaus Aehligc37fc162016-09-30 12:30:32 +000055 ```sh
Peter Mouncea27949e2016-09-26 15:58:53 +000056 choco uninstall bazel
Peter Mouncef9fa89f2016-11-03 10:26:29 +000057 # should remove bazel from the system
Peter Mouncea27949e2016-09-26 15:58:53 +000058 ```
59
Peter Mouncef9fa89f2016-11-03 10:26:29 +000060Chocolatey's moderation process automates checks here as well.
Peter Mouncea27949e2016-09-26 15:58:53 +000061
Peter Mouncef9fa89f2016-11-03 10:26:29 +000062### Release
Peter Mouncea27949e2016-09-26 15:58:53 +000063
Peter Mouncef9fa89f2016-11-03 10:26:29 +000064Modify `tools/parameters.json` for the new release's URI and checksum once the release has been published to github releases.
65
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
73Chocolatey.org will then run automated checks and respond to the push via email to the maintainers.