You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a `--stamp` build, this will replace the string "0.0.0-PLACEHOLDER" in any file included in the package with the current value of the `STABLE_GIT_COMMIT` variable.
33
+
However without stamping the placeholder will be left as-is.
29
34
30
-
This is a script that prints variable/value pairs.
31
-
Make sure you set the executable bit, eg. `chmod 755 tools/bazel_stamp_vars.sh`.
32
-
For example, we could run `git describe` to get the current tag:
35
+
## Stamping with a Workspace status script
36
+
37
+
To define additional statuses, pass the `--workspace_status_command` argument to `bazel`.
38
+
The value of this flag is a path to a script that prints space-separated key/value pairs, one per line, such as
For a more full-featured script, take a look at the [bazel_stamp_vars in Angular]
60
+
## Release script
40
61
41
-
Finally, we recommend a release script around Bazel. We typically have more than one npm package published from one Bazel workspace, so we do a `bazel query` to find them, and publish in a loop. Here is a template to get you started:
62
+
If you publish more than one package from your workspace, you might want a release script around Bazel.
63
+
A nice pattern is to do a `bazel query` to find publishable targets, build them in parallel, then publish in a loop.
64
+
Here is a template to get you started:
42
65
43
66
```sh
44
67
#!/usr/bin/env bash
@@ -63,8 +86,6 @@ for pkg in $PKG_NPM_LABELS ; do
63
86
done
64
87
```
65
88
66
-
> WARNING: Bazel can't track changes to git tags. That means it won't rebuild a target if only the result of the workspace_status_command has changed. So changes to the version information may not be reflected if you re-build the package or bundle, and nothing in the package or bundle has changed.
67
-
68
89
See https://www.kchodorow.com/blog/2017/03/27/stamping-your-builds/ for more background.
69
90
70
91
[bazel_stamp_vars in Angular]: https://github.com/angular/angular/blob/master/tools/bazel_stamp_vars.sh
0 commit comments