Skip to content

Commit 9d5ce5f

Browse files
edgrosvenorEd Grosvenorclaude
authored
Fix Satis deploy docs: pin dev-main, separate install dir from executable path (#10)
Three real deploy bugs hit in the field: 1. `composer create-project composer/satis` unpinned resolves to satis 1.0.0 (the only stable tag), which requires php ^5.6 || ^7.0 and fails on modern PHP. Pin composer/satis:dev-main. 2. deploy.md used $CRATE_SATIS_PATH as both the create-project target (a directory) and the value BuildSatis executes as the satis binary. These are two different paths: the executable lands at <install-dir>/bin/satis and Composer does not link a root package's bin into vendor/bin. Build Command and crate:install examples now use distinct install-dir / executable paths. 3. The config default (vendor/bin/satis) contradicts the "keep Satis isolated" rule — it only exists if Satis is required into the app vendor tree. All three docs now describe CRATE_SATIS_PATH as the isolated Satis executable path and state isolated deploys must set it explicitly; config gains a clarifying comment (default unchanged). Co-authored-by: Ed Grosvenor <ed@artisan.build> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 5abe1f1 commit 9d5ce5f

4 files changed

Lines changed: 24 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Crate-specific server config lives in `config/crate-server.php`:
7474

7575
- `CRATE_URL`: the public registry URL used as Satis `homepage` and archive prefix.
7676
- `CRATE_ARCHIVE_DISK`: disk for Composer metadata and mirrored dist archives.
77-
- `CRATE_SATIS_PATH`: path to the isolated Satis binary.
77+
- `CRATE_SATIS_PATH`: path to the isolated Satis executable (`<install-dir>/bin/satis`), run directly by the build job. Install Satis with `composer create-project composer/satis:dev-main` (an unpinned install resolves to the ancient 1.0.0 stable and fails on modern PHP). The default (`vendor/bin/satis`) only applies if Satis is installed into the app's vendor directory, which is discouraged — isolated deploys must set this explicitly. See `docs/deploy.md`.
7878
- `CRATE_OUTPUT_DIR`: storage prefix for generated registry output.
7979

8080
Do not hand-set Laravel Cloud managed resource credentials for database, queue, cache, or object storage. Let Cloud inject them.

docs/deploy.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,22 @@ Install the app dependencies, then install Satis as an isolated tool with its ow
2424

2525
```bash
2626
composer install --no-dev --prefer-dist
27-
composer create-project composer/satis "$CRATE_SATIS_PATH" --no-dev
27+
composer create-project composer/satis:dev-main ../satis-tool --no-dev
2828
```
2929

30-
Do not `composer require` Satis into the Crate app. It must stay isolated because its dependency tree is separate from the Laravel app's dependency tree.
30+
Pin `dev-main` explicitly. Satis has no recent stable tag, so an unpinned `composer create-project composer/satis` resolves to satis 1.0.0 and fails on any modern runtime with:
31+
32+
```
33+
Cannot use composer/satis's latest version 1.0.0 as it requires php ^5.6 || ^7.0 which is not satisfied by your platform.
34+
```
35+
36+
Note the two distinct paths involved. The `create-project` target (`../satis-tool` above) is the install *directory*; the Satis *executable* lands inside it at `../satis-tool/bin/satis` (Composer does not link a root package's bin into `vendor/bin`). `CRATE_SATIS_PATH` must point at the executable, not the install directory — Crate's build job runs that path directly:
37+
38+
```bash
39+
CRATE_SATIS_PATH=../satis-tool/bin/satis # prefer an absolute path in real deploys
40+
```
41+
42+
Do not `composer require` Satis into the Crate app. It must stay isolated because its dependency tree is separate from the Laravel app's dependency tree. Because Satis lives outside the app, the config default for `CRATE_SATIS_PATH` (`vendor/bin/satis`, which would only exist if Satis were required into the app) never applies — an isolated deploy must always set `CRATE_SATIS_PATH` explicitly.
3143

3244
Ensure `git` is available anywhere Satis runs, including the build and queue runtimes. Satis uses it to read VCS repositories during registry builds.
3345

@@ -40,18 +52,20 @@ Run the installer on the deployed environment. Run it interactively (it prompts
4052
php artisan crate:install
4153

4254
# non-interactive (a bare crate:install with no TTY and no flags makes no changes)
55+
# --satis-path is the Satis EXECUTABLE inside the isolated install from the
56+
# Build Command step, not the install directory
4357
php artisan crate:install --no-interaction \
4458
--url="https://crate.example.com" \
4559
--archive-disk="crate-archive" \
46-
--satis-path="$CRATE_SATIS_PATH" \
60+
--satis-path="/path/to/satis-tool/bin/satis" \
4761
--credential-api=true
4862
```
4963

5064
The installer is idempotent and will not overwrite an existing value without confirmation (pass `--force` non-interactively). It configures only these app values:
5165

5266
- `CRATE_URL`: the public Crate registry URL used as the Satis homepage and archive prefix.
5367
- `CRATE_ARCHIVE_DISK`: the object-storage filesystem disk name Crate should use for Satis output and mirrored archives.
54-
- `CRATE_SATIS_PATH`: the path to the isolated Satis binary or installation.
68+
- `CRATE_SATIS_PATH`: the path to the isolated Satis executable (`<install-dir>/bin/satis`), which the build job executes directly. The config default (`vendor/bin/satis`) only applies if Satis is installed into the app's own vendor directory — which the Build Command section advises against — so isolated deploys must set this explicitly.
5569
- `BUILT_FOR_CLOUD_CREDENTIAL_API_ENABLED`: whether built-for-cloud's admin-token credential API is enabled.
5670

5771
Then run migrations:

packages/crate-server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Environment variables:
7676

7777
- `CRATE_URL`: public registry URL used by Satis metadata and dist archive URLs.
7878
- `CRATE_ARCHIVE_DISK`: storage disk for generated metadata and mirrored archives. Defaults to `FILESYSTEM_DISK` then `local`.
79-
- `CRATE_SATIS_PATH`: isolated Satis binary path. Defaults to `vendor/bin/satis`.
79+
- `CRATE_SATIS_PATH`: path to the isolated Satis executable (`<install-dir>/bin/satis`), executed directly by `BuildSatis`. Defaults to `vendor/bin/satis`, which only applies if Satis is installed into the app's own vendor tree — isolated installs (recommended; install via `composer create-project composer/satis:dev-main`) must set it explicitly.
8080
- `CRATE_OUTPUT_DIR`: storage prefix for generated registry output. Defaults to `satis`.
8181
- `CRATE_DB_*`: optional separate database connection settings. If omitted, the app's default database connection is reused as `crate`.
8282

packages/crate-server/config/crate-server.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
return [
66
'url' => env('CRATE_URL'),
77
'archive_disk' => env('CRATE_ARCHIVE_DISK', env('FILESYSTEM_DISK', 'local')),
8+
// The Satis EXECUTABLE (BuildSatis runs this path directly), not an install
9+
// directory. The default only exists if Satis is required into the app
10+
// vendor tree; isolated installs must set CRATE_SATIS_PATH to
11+
// <install-dir>/bin/satis. See docs/deploy.md.
812
'satis_path' => env('CRATE_SATIS_PATH', base_path('vendor/bin/satis')),
913
'output_dir' => env('CRATE_OUTPUT_DIR', 'satis'),
1014

0 commit comments

Comments
 (0)