Skip to content

Commit 7ae0055

Browse files
committed
feat(install): support SENTRY_VERSION env var for version pinning
Add SENTRY_VERSION environment variable to the curl install script so users can pin a version without inline flags. Useful for CI/CD pipelines and Dockerfiles. The --version flag takes precedence if both are set. - Read SENTRY_VERSION as the default for requested_version in install script - Add SENTRY_VERSION to the usage help text and examples - Document in getting-started.mdx with stable and nightly examples - Add to configuration.md environment variables reference
1 parent 6a41c42 commit 7ae0055

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

docs/src/content/docs/configuration.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ Override the directory where the CLI stores its database (credentials, caches, d
7171
export SENTRY_CONFIG_DIR=/path/to/config
7272
```
7373

74+
### `SENTRY_VERSION`
75+
76+
Pin a specific version for the [install script](./getting-started/#install-script). Accepts a version number (e.g., `0.19.0`) or `nightly`. The `--version` flag takes precedence if both are set.
77+
78+
```bash
79+
SENTRY_VERSION=nightly curl https://cli.sentry.dev/install -fsS | bash
80+
```
81+
82+
This is useful in CI/CD pipelines and Dockerfiles where you want reproducible installations without inline flags.
83+
7484
### `SENTRY_PLAIN_OUTPUT`
7585

7686
Force plain text output (no colors or ANSI formatting). Takes precedence over `NO_COLOR`.

docs/src/content/docs/getting-started.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ Install the nightly build (built from `main`, updated on every commit):
2121
curl https://cli.sentry.dev/install -fsS | bash -s -- --version nightly
2222
```
2323

24+
You can also use the `SENTRY_VERSION` environment variable to pin a version,
25+
which is especially useful in CI/CD pipelines and Dockerfiles:
26+
27+
```bash
28+
# Pin to a specific stable version
29+
SENTRY_VERSION=0.19.0 curl https://cli.sentry.dev/install -fsS | bash
30+
31+
# Pin to nightly
32+
SENTRY_VERSION=nightly curl https://cli.sentry.dev/install -fsS | bash
33+
```
34+
35+
The `--version` flag takes precedence over `SENTRY_VERSION` if both are set.
2436
The chosen channel is persisted so that `sentry cli upgrade` automatically
2537
tracks the same channel on future updates.
2638

install

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,18 @@ Options:
8888
8989
Environment Variables:
9090
SENTRY_INSTALL_DIR Override the installation directory
91+
SENTRY_VERSION Install a specific version (e.g., 0.19.0, nightly)
9192
9293
Examples:
9394
curl -fsSL https://cli.sentry.dev/install | bash
9495
curl -fsSL https://cli.sentry.dev/install | bash -s -- --version nightly
95-
curl -fsSL https://cli.sentry.dev/install | bash -s -- --version 0.2.0
96+
curl -fsSL https://cli.sentry.dev/install | bash -s -- --version 0.19.0
97+
SENTRY_VERSION=nightly curl -fsSL https://cli.sentry.dev/install | bash
9698
SENTRY_INSTALL_DIR=~/.local/bin curl -fsSL https://cli.sentry.dev/install | bash
9799
EOF
98100
}
99101

100-
requested_version=""
102+
requested_version="${SENTRY_VERSION:-}"
101103
no_modify_path=false
102104
no_completions=false
103105
while [[ $# -gt 0 ]]; do

0 commit comments

Comments
 (0)