Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 1 | --- |
| 2 | layout: documentation |
| 3 | title: Windows Chocolatey maintenance |
| 4 | --- |
| 5 | |
| 6 | Installing Bazel on Windows |
| 7 | =========================== |
| 8 | |
| 9 | You can install the unofficial package using the [chocolatey](https://chocolatey.org) package manager: |
| 10 | |
Klaus Aehlig | c37fc16 | 2016-09-30 12:30:32 +0000 | [diff] [blame] | 11 | ```sh |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 12 | choco install bazel |
| 13 | ``` |
| 14 | |
| 15 | This will install the latest available version of bazel, and dependencies. |
| 16 | |
| 17 | This package is experimental; please provide feedback (`@petemounce` in issue tracker). |
| 18 | |
| 19 | |
| 20 | Maintaining Bazel Chocolatey package on Windows |
| 21 | =============================================== |
| 22 | |
| 23 | ### Prerequisites |
| 24 | |
| 25 | You 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 | |
| 33 | Compile bazel with msys2 shell and `compile.sh`. |
| 34 | |
| 35 | ```powershell |
| 36 | pushd scripts/packages/chocolatey |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame^] | 37 | ./build.ps1 -version 0.3.2 -mode local |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 38 | popd |
| 39 | ``` |
| 40 | |
| 41 | Should result in `scripts/packages/chocolatey/bazel.<version>.nupkg` being created. |
| 42 | |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame^] | 43 | The `build.ps1` script supports `mode` values `local`, `rc` and `release`. |
| 44 | |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 45 | #### Test |
| 46 | |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame^] | 47 | 0. Build the package (with `-mode local`) |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 48 | * run a webserver (`python -m SimpleHTTPServer` in `scripts/packages/chocolatey` is convenient and starts one on `http://localhost:8000`) |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 49 | 0. 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 Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 53 | 0. Test the uninstall |
| 54 | |
Klaus Aehlig | c37fc16 | 2016-09-30 12:30:32 +0000 | [diff] [blame] | 55 | ```sh |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 56 | choco uninstall bazel |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame^] | 57 | # should remove bazel from the system |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 58 | ``` |
| 59 | |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame^] | 60 | Chocolatey's moderation process automates checks here as well. |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 61 | |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame^] | 62 | ### Release |
Peter Mounce | a27949e | 2016-09-26 15:58:53 +0000 | [diff] [blame] | 63 | |
Peter Mounce | f9fa89f | 2016-11-03 10:26:29 +0000 | [diff] [blame^] | 64 | Modify `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 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 | |
| 73 | Chocolatey.org will then run automated checks and respond to the push via email to the maintainers. |