Packaging
vendor/bin/scaleway-package [--runtime=php84] [function.zip]
With --runtime, it first runs the compatibility check against that Function Runtime, and refuses to build the zip on an incompatible Platform Requirement.
It zips your application as it is, composer.json and composer.lock included, but without vendor/ nor var/: Scaleway runs composer install --no-dev from the shipped lock at deploy time, Composer scripts included, and replaces any shipped vendor/ (ADR 0008).
Executable bits are kept, and symbolic links are followed: their target is zipped.
It refuses to build the zip, as Scaleway would install something else or fail without failing the deployment, when:
handler.phporcomposer.lockis missing;composer.lockis not up to date withcomposer.json;composer.jsondeclares apathrepository, orcomposer.lockinstalls a package from a local path: Scaleway cannot resolve them.
| Shipped | Not shipped |
|---|---|
Your code, composer.json, composer.lock, handler.php |
vendor/ and var/ (installed and built on the platform) |
.env, .env.prod... as they are |
tests/, phpunit.xml(.dist), .phpunit.cache, .phpunit.result.cache, .php-cs-fixer.cache |
.env.local, .env.local.php, .env.*.local |
|
.git, .idea, .vscode, .DS_Store, node_modules anywhere |
|
.terraform, *.tfstate, *.tfstate.* anywhere (Terraform state holds secrets in clear) |
The full list is Packager::EXCLUDES in src/Packager.php.
Scaleway accepts zips up to 100 MiB, and up to 500 MiB of unzipped code (limits).
scaleway-package warns when the zip or its content exceeds either, but still writes it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|