Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `apm install --frozen` performs a CI-safe, read-only install that fails fast (exit 1) when `apm.lock.yaml` is missing or out of sync with `apm.yml`; mutually exclusive with `--update`. (#1244)
- Zero-config private-package auth on github.com, `*.ghe.com`, and GHES when the `gh` CLI is logged in: APM uses `gh auth token --hostname <host>` before falling back to `git credential fill`. (#630)
- GitLab marketplace and install support: `gitlab.com` and self-managed instances (via `GITLAB_HOST` / `APM_GITLAB_HOSTS`) use GitLab REST v4 for `marketplace.json` and raw file reads; nested group paths are disambiguated via object-form `git:` + `path:`. (#1149)
- **`install.ps1` (Windows)** now mirrors **`install.sh`**: `APM_INSTALL_DIR`, `GITHUB_URL`, `APM_REPO`, and `VERSION` environment variables; pinning `VERSION` skips the releases/latest API; `GITHUB_URL` selects GitHub.com (`api.github.com`) vs GHES (`{host}/api/v3`) for latest discovery. (#668)
- Virtual subdirectory and raw-file packages now resolve from self-hosted Git services (Gitea, Gogs) via raw URL with API v1/v3 fallback. (#587)
- `git: parent` lets packages in a git monorepo reference sibling paths via `{ git: parent, path: ... }` without repeating the full `git:` URL; the lockfile stores expanded host, repo, and resolved ref like every other virtual git dependency. (#1149)
- `shared/apm.md` gh-aw workflow exposes a `target:` import input (default `all`) so consumer workflows can ship slim, single-harness bundles. (#1184)
Expand Down
37 changes: 29 additions & 8 deletions docs/src/content/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The installer automatically detects your platform (macOS/Linux/Windows, Intel/AR

### Installer options

The Unix installer supports environment variables for custom environments:
**macOS / Linux (`install.sh`):**

```bash
# Install a specific version
Expand All @@ -42,15 +42,36 @@ curl -sSL https://aka.ms/apm-unix | APM_INSTALL_DIR=$HOME/.local/bin sh
GITHUB_URL=https://github.corp.com VERSION=v1.2.3 sh install.sh
```

**Windows (`install.ps1` in PowerShell):**

```powershell
# Pin a version (skips GitHub API - required for many air-gapped / GHES setups)
$env:VERSION = "v1.2.3"; irm https://aka.ms/apm-windows | iex

Comment thread
abhinavgautam01 marked this conversation as resolved.
# Or pass a positional parameter when running a saved script:
# .\install.ps1 v1.2.3

# Custom directory for apm.cmd (default: %LOCALAPPDATA%\Programs\apm\bin)
$env:APM_INSTALL_DIR = "$env:LOCALAPPDATA\Programs\apm\bin"; irm https://aka.ms/apm-windows | iex

# Fork, enterprise host, or internal mirror
$env:GITHUB_URL = "https://github.corp.com"
$env:APM_REPO = "my-org/apm"
$env:VERSION = "v1.2.3"
irm https://aka.ms/apm-windows | iex
```

| Variable | Default | Description |
|----------|---------|-------------|
| `APM_INSTALL_DIR` | `/usr/local/bin` | Directory for the `apm` symlink |
| `APM_LIB_DIR` | `$(dirname APM_INSTALL_DIR)/lib/apm` | Directory for the full binary bundle |
| `GITHUB_URL` | `https://github.com` | Base URL for downloads (mirrors, GHE) |
| `APM_REPO` | `microsoft/apm` | GitHub repository |
| `VERSION` | *(latest)* | Pin a specific release (skips GitHub API) |

> **Note:** When using `GITHUB_URL` for a GitHub Enterprise or air-gapped mirror, set `VERSION` as well. The GitHub API call for latest-release discovery still targets `api.github.com`; `VERSION` bypasses it entirely.
| `APM_INSTALL_DIR` | `/usr/local/bin` (Unix) / `%LOCALAPPDATA%\Programs\apm\bin` (Windows) | Directory for the `apm` symlink / `apm.cmd` shim |
| `APM_LIB_DIR` | `$(dirname APM_INSTALL_DIR)/lib/apm` | *(Unix only)* Directory for the full binary bundle |
| `GITHUB_URL` | `https://github.com` | Base URL for downloads (mirrors, GHES) |
| `APM_REPO` | `microsoft/apm` | GitHub repository (`owner/name`) |
| `VERSION` | *(latest)* | Pin a specific release tag (skips the **releases/latest** HTTP API) |

> **Note - Unix (`install.sh`):** Latest-release discovery still calls `https://api.github.com/repos/.../releases/latest` unless `VERSION` is set. For GHES or mirrors with no access to `api.github.com`, pin `VERSION` so the script never hits that endpoint.
>
> **Note - Windows (`install.ps1`):** The **releases/latest** URL is derived from `GITHUB_URL`: `https://api.github.com` for GitHub.com, or `{GITHUB_URL}/api/v3` for GitHub Enterprise Server. Air-gapped runners should still set `VERSION` so the installer does not need the API at all.

## Package managers

Expand Down
Loading