Skip to content

Commit 0f2bcc6

Browse files
committed
docs: Update cargo-make commands so that tasks come after arguments
Due to a change in `cargo-make` v0.35.3, arguments like `-e PUBLISH_REGION` must be passed before the task name (instead of after).
1 parent 97400c3 commit 0f2bcc6

7 files changed

+19
-17
lines changed

BUILDING.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,17 @@ To use the image in Amazon EC2, we need to register the image as an AMI.
9898
For a simple start, pick an [EC2 region](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions), then run:
9999

100100
```
101-
cargo make ami -e PUBLISH_REGIONS=your-region-here
101+
cargo make -e PUBLISH_REGIONS=your-region-here ami
102102
```
103103

104+
Note that the task ("ami") must come **after** the arguments to `cargo make` that are specified with `-e`.
105+
104106
Your new AMI ID will be printed after it's registered.
105107

106108
If you built your image for a different architecture or variant, just use the same arguments here:
107109

108110
```
109-
cargo make ami -e PUBLISH_REGIONS=your-region-here -e BUILDSYS_VARIANT=my-variant-here
111+
cargo make -e PUBLISH_REGIONS=your-region-here -e BUILDSYS_VARIANT=my-variant-here ami
110112
```
111113

112114
(There's a lot more detail on building and managing AMIs in the [PUBLISHING](PUBLISHING.md) guide.)

Makefile.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ script = [
392392
set -e
393393
if [ -z "${PACKAGE}" ]; then
394394
echo "The PACKAGE environment variable must be set. For example:"
395-
echo "cargo make build-package -e PACKAGE=kernel"
395+
echo "cargo make -e PACKAGE=kernel build-package"
396396
exit 1
397397
fi
398398
@@ -1031,7 +1031,7 @@ pubsys \
10311031
[tasks._upload-ova-base]
10321032
# Rather than depend on "build", which currently rebuilds images each run, we
10331033
# depend on publish-tools and check for the image files below to save time.
1034-
# This does mean that `cargo make` must be run before
1034+
# This does mean that `cargo make` must be run before
10351035
# `cargo make _upload-ova-base`.
10361036
dependencies = ["setup-build", "publish-tools"]
10371037
script_runner = "bash"

PUBLISHING-AWS.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ If you want to change the name or description of your AMI, you can add on `-e PU
3030
If you use different accounts to make and test your AMIs, you can grant access to specific accounts like this:
3131

3232
```shell
33-
cargo make grant-ami -e GRANT_TO_USERS=0123456789,9876543210
33+
cargo make -e GRANT_TO_USERS=0123456789,9876543210 grant-ami
3434
```
3535

3636
(Later, if you need to revoke access, you can do this:)
3737

3838
```shell
39-
cargo make revoke-ami -e REVOKE_FROM_USERS=0123456789,9876543210
39+
cargo make -e REVOKE_FROM_USERS=0123456789,9876543210 revoke-ami
4040
```
4141

4242
> Note: similar to `cargo make ami`, you can specify `PUBLISH_REGIONS` on the command line if you don't want to make an `Infra.toml` config.
@@ -94,7 +94,7 @@ Once you're satisfied with your image and parameters, you can promote the parame
9494
Note: if you want to customize the SSM parameters that get set, you can copy and modify the existing template file, then point to your file like this:
9595

9696
```shell
97-
cargo make ssm -e PUBLISH_SSM_TEMPLATES_PATH=/my/template/path
97+
cargo make -e PUBLISH_SSM_TEMPLATES_PATH=/my/template/path ssm
9898
```
9999

100100
### Making your AMIs public
@@ -122,7 +122,7 @@ The SSM parameter names include version numbers, which is handy for testing, but
122122
Once we're satisfied, we can promote the SSM parameters to simpler names.
123123

124124
```shell
125-
cargo make promote-ssm -e SSM_TARGET=latest
125+
cargo make -e SSM_TARGET=latest promote-ssm
126126
```
127127

128128
This will copy the fully versioned parameter from earlier, something like:

PUBLISHING-VMWARE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ datacenters = ["foo", "bar"]
4646
Then you can easily upload your OVA, specifying the variant you wish to upload (currently only VMware variants).
4747

4848
```shell
49-
cargo make upload-ova -e BUILDSYS_VARIANT=vmware-k8s-1.20
49+
cargo make -e BUILDSYS_VARIANT=vmware-k8s-1.20 upload-ova
5050
```
5151

5252
If you would like to upload your OVA as a VM template, you can do this in a single step:
5353

5454
```shell
55-
cargo make vmware-template -e BUILDSYS_VARIANT=vmware-k8s-1.20
55+
cargo make -e BUILDSYS_VARIANT=vmware-k8s-1.20 vmware-template
5656
```
5757

5858
You can override the list of datacenters to upload to by specifying `VMWARE_DATACENTERS`:

PUBLISHING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cargo make -e BUILDSYS_VARIANT=my-variant -e BUILDSYS_ARCH=my-arch
3535
...then you can then build a repo for it like this:
3636

3737
```shell
38-
cargo make repo -e BUILDSYS_VARIANT=my-variant -e BUILDSYS_ARCH=my-arch
38+
cargo make -e BUILDSYS_VARIANT=my-variant -e BUILDSYS_ARCH=my-arch repo
3939
```
4040

4141
## Publishing your image
@@ -75,7 +75,7 @@ RELEASE_START_TIME="$(date '+%Y-%m-%dT%H:%M:%S%:z' -d 'Monday 10am')"
7575
Now we can create the repo using that time:
7676

7777
```shell
78-
cargo make repo -e "RELEASE_START_TIME=${RELEASE_START_TIME}"
78+
cargo make -e "RELEASE_START_TIME=${RELEASE_START_TIME}" repo
7979
```
8080

8181
### Roles and keys
@@ -249,7 +249,7 @@ If you want to use a different policy, pass `-e PUBLISH_WAVE_POLICY_PATH=sources
249249
For example, to use the accelerated schedule:
250250

251251
```shell
252-
cargo make repo -e PUBLISH_WAVE_POLICY_PATH=sources/updater/waves/accelerated-waves.toml
252+
cargo make -e PUBLISH_WAVE_POLICY_PATH=sources/updater/waves/accelerated-waves.toml repo
253253
```
254254

255255
To learn more about waves, check out the [README](sources/updater/waves).
@@ -263,7 +263,7 @@ The [default policy](tools/pubsys/policies/repo-expiration/2w-2w-1w.toml) sets t
263263
If you want to use different expiration policy, you can copy and modify the existing policy, then point to your file like this:
264264

265265
```shell
266-
cargo make repo -e PUBLISH_EXPIRATION_POLICY_PATH=/my/policy/path
266+
cargo make -e PUBLISH_EXPIRATION_POLICY_PATH=/my/policy/path repo
267267
```
268268

269269
**Note:** remember to update your repo before the expiration date.

packages/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ The variants workspace's `Cargo.lock` may be affected by adding a package.
233233
To build your package, run the following command in the top-level Bottlerocket directory.
234234

235235
```sh
236-
cargo make build-package -e PACKAGE=libwoof
236+
cargo make -e PACKAGE=libwoof build-package
237237
```
238238

239239
This will build your package and its dependencies.

tools/pubsys/Infra.toml.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# at the root of the repo, then edit the settings below to match your use case.
44

55
# You can have any number of repos defined and build a specific one by running like this:
6-
# cargo make repo -e PUBLISH_REPO=myrepo
6+
# cargo make -e PUBLISH_REPO=myrepo repo
77
[repo.default]
88
# URL to your root role JSON file; can be a file:// URL for local files. If
99
# you don't specify one here, a file will be generated for you under /roles.
@@ -65,7 +65,7 @@ datacenters = ["north", "south"]
6565
# ***
6666

6767
# Optional common configuration
68-
# This configuration allow values to be set in a single place if they are common in
68+
# This configuration allow values to be set in a single place if they are common in
6969
# multiple datacenters. They can be overridden in the datacenter's block below.
7070
[vmware.common]
7171
network = "a_network"

0 commit comments

Comments
 (0)