diff --git a/.optimize-cache.json b/.optimize-cache.json index 51c28c7ab3a..c13f849465a 100644 --- a/.optimize-cache.json +++ b/.optimize-cache.json @@ -214,6 +214,7 @@ "static/images/blog/announcing-database-reads-and-writes-pricing/cover.png": "5c9557e393b07822a76cc1c2e20e759742029cd6a0c7623fd4a8085c364c49fc", "static/images/blog/announcing-database-upsert/cover.png": "40839c8f5c28a5d78c2507f12e165ac8f176c53b81d8eb6b77b46d1c58f381dc", "static/images/blog/announcing-db-operators/cover.png": "9e0adb9ac1849e40b6a3c30ab4923ac63d1f551be1003ecb9804e4989bb2cf3c", + "static/images/blog/announcing-deployment-retention/cover.png": "e6c59f73d83c1b88aed82a8974df97de83ab653241a5717f20b407809fa46ba9", "static/images/blog/announcing-encrypted-string-attributes/cover.png": "f3d1d0a022771392019c760c6dcf88fc231a7f96d19e2eb61d89b3605e818463", "static/images/blog/announcing-image-transformations-pricing/cover.png": "dfdd070a46b5f8c66d7b4781cc3dc61faa10c80307882e206be0ff7d46ca77db", "static/images/blog/announcing-image-transformations-pricing/usage-component.png": "e24a8b710ea5de5ee2fe7c2c4507f54dccb3530a602027fc7a4265d5fc7b6eca", @@ -1408,8 +1409,10 @@ "static/images/docs/databases/scale-policies.png": "549c929932a92902c6a17684730a4bffe0c52ed8dd3d9bebc7ecc7818c81f244", "static/images/docs/dev-keys/dark.png": "137a92c18e9dfb2c000dea70d7fea09895abe2b46a69bdf8b736997e21c457ba", "static/images/docs/dev-keys/light.png": "7737135bb6c721adad6761d6c00616d3e9f5a88f153c8481ca55cdf481d63c42", + "static/images/docs/functions/dark/deployment-retention.png": "9bd06506317c6e5d609eae5c9214c31bb2dc0a836a0c38ca0266b1ffe004379c", "static/images/docs/functions/dark/env-variables.png": "0fe62180f8b3b96f7944c91afcc87dda42cf52d8ce10672608c1df009b048b42", "static/images/docs/functions/dark/template.png": "4149a261979cb36cf74309d1836a3fcd926f2d33587e92080d541ffcbc3ad19c", + "static/images/docs/functions/deployment-retention.png": "3ce7d938378dc5bb897aa4d211b75734971d09a10c645a6b0475c183d400c1ac", "static/images/docs/functions/env-variables.png": "003c18ef56a95f0784c9ffd609e313955bd83b61ef277c454bb7dd5b2192280b", "static/images/docs/functions/execution/dark/execute-function.png": "69063c276041e1e8cea09fb7aa27d3df6727fa6806d15101ac291e1b51f14344", "static/images/docs/functions/execution/dark/scheduled-execution-function.png": "19fd1f34644186c0113f060c4f4b9c42ecd8392e8a86f32df44f90086943ba33", @@ -1557,6 +1560,7 @@ "static/images/docs/sites/dark/create-first-site.png": "f8533eb166c15a1acbeee7b2ba2ff3427682419be6f4ef80ebf1a17d97acbd55", "static/images/docs/sites/dark/create-site-wizard.png": "ebd1295574354780dc322723c0eebf0318c625541b2d433bf2703145fa083eef", "static/images/docs/sites/dark/deployment-logs.png": "d0fa8808c1fa74ed1762e1a77842d8c70c6a1d746da467f8c5622b1659d379f9", + "static/images/docs/sites/dark/deployment-retention.png": "e34f3af185354cc9df9392790393a00530fa7a1b790ccc464a1b7f36d71d01d6", "static/images/docs/sites/dark/env-variables.png": "091fee9e8505df6c1b9b3c20ab59be40b2effe5299ad5202b43cf2cfe7b5b085", "static/images/docs/sites/dark/git-repo.png": "af8daabb8d6ff48e0a95d45d5a643b4daec8df6301dddc098dd651bdfd1f1284", "static/images/docs/sites/dark/github-source.png": "2ee329e009f045a879736a39cef8fca262da06c568eb6bac2ff1b7a70269989a", @@ -1570,6 +1574,7 @@ "static/images/docs/sites/dark/site-templates.png": "8667c6a812936b305f97e90119a282f43b057de9112d2103d66745cd6e9ffa58", "static/images/docs/sites/dark/timeout.png": "55485f8c89156e37f128725a6dc593be8ddab6e5f5b7000dc6f48500bb90cca8", "static/images/docs/sites/deployment-logs.png": "e52c90b303ea699d6ac79de5ac07efadf52a8738f49ce3fb1cf8cc21319551d2", + "static/images/docs/sites/deployment-retention.png": "e2c7fbcf9acca5dde18f57d562096e0dc7e83222b188223058ad33b92b5b4feb", "static/images/docs/sites/env-variables.png": "f51eee95b324f9cc0d7ef995b30ce795f54cb05ffca68adf109c3149eabfee6e", "static/images/docs/sites/git-repo.png": "123ac583cd78bf0ca56fb045b168059b4292f713f470988077f4101a9b5f37c9", "static/images/docs/sites/github-source.png": "eb58d2223e2a71c4ed4e91352e365fbc2bc88a3013fa44e3f618e843e26da64a", diff --git a/src/routes/blog/post/announcing-deployment-retention/+page.markdoc b/src/routes/blog/post/announcing-deployment-retention/+page.markdoc new file mode 100644 index 00000000000..57ab5b5b8e5 --- /dev/null +++ b/src/routes/blog/post/announcing-deployment-retention/+page.markdoc @@ -0,0 +1,90 @@ +--- +layout: post +title: "Announcing deployment retention for Appwrite Functions and Sites" +description: Deployment retention lets you automatically delete inactive Appwrite Functions and Sites deployments while keeping deployments within the retention window available for rollback. +date: 2026-05-15 +cover: /images/blog/announcing-deployment-retention/cover.avif +timeToRead: 4 +author: aditya-oberai +category: announcement +featured: false +faqs: + - question: "What is deployment retention in Appwrite?" + answer: "Deployment retention controls how long Appwrite keeps non-active [Functions](/docs/products/functions/deployments#deployment-retention) and [Sites](/docs/products/sites/deployments#deployment-retention) deployments. The active deployment is always kept, and older non-active deployments are deleted after the configured number of days." + - question: "Does deployment retention delete my active deployment?" + answer: "No. Appwrite always keeps the active deployment for a Function or Site, even when it is older than the configured retention period. Retention only applies to non-active deployments." + - question: "What values can I use for deployment retention?" + answer: "Use `0` to keep non-active deployments forever, or set any value from `1` to `36500` days. The Console includes common presets from 1 week to 10 years, and the API accepts custom day counts in the supported range." + - question: "Can I configure deployment retention for both Functions and Sites?" + answer: "Yes. Deployment retention is available for both [Appwrite Functions](/docs/products/functions/deployments#deployment-retention) and [Appwrite Sites](/docs/products/sites/deployments#deployment-retention), with the same `deploymentRetention` setting in the API and Server SDKs." + - question: "Does changing deployment retention require a redeploy?" + answer: "No. Deployment retention is a resource setting, not a build setting. You can update it from the Console or Server SDKs without rebuilding your active Function or Site deployment." + - question: "Can I set deployment retention from a Server SDK?" + answer: "Yes. Set `deploymentRetention` when you create or update a Function or Site. When using an update method, pass the existing settings you want to keep along with the new retention value." +--- + +Deployments pile up quickly. Every push to a production branch, every preview deployment, and every manual rebuild leaves behind a version you may need for debugging or rollback. Some of that history is useful. Some of it stops being useful after a week, a month, or a release cycle, but it keeps occupying storage long after you would ever roll back to it. + +Today, we are announcing **deployment retention for Appwrite Functions and Sites**. + +Deployment retention lets you choose how long Appwrite keeps non-active deployments before automatically deleting them. You free up storage, lower your storage costs, and keep your deployment list focused on the builds you actually care about. Your active deployment is always protected, and you can still keep deployments forever when your workflow calls for a long rollback window. + +# What deployment retention gives you + +- **Lower storage costs:** Deployment artifacts count toward your project's overall storage allowance on Appwrite Cloud. Retention reclaims that space automatically, so unused builds stop pushing you toward [additional storage overage](/pricing). +- **Cleaner deployment history:** Keep the deployment list focused on recent builds instead of every preview or retry your team has ever created. +- **Protected active deployment:** The deployment currently serving your Function or Site is never removed by retention cleanup. +- **Simple Console controls:** Choose **Keep deployments forever** or pick a retention window from common presets like 1 week, 1 month, 6 months, or 1 year. +- **API support:** Configure the same behavior with the `deploymentRetention` field when creating or updating Functions and Sites. +- **Custom retention windows:** Use any value from `1` to `36500` days, or `0` for unlimited retention. + +# How to configure deployment retention + +In the Appwrite Console, open the Function or Site you want to configure, go to **Settings** > **Deployment retention**, then choose whether to keep deployments forever or keep non-active deployments for a specific period. + +![Deployment retention settings for an Appwrite Function](/images/docs/functions/dark/deployment-retention.avif) + +For example, you might keep deployments for 90 days on a production Function and 30 days on a preview-heavy Site. Appwrite will keep the active deployment and clean up older non-active deployments during maintenance. + +You can also configure retention through the Server SDKs using `deploymentRetention`. The examples below focus on the relevant field. When you update an existing resource, include any current settings you want to preserve. + +```js +const func = await functions.get({ + functionId: '' +}); + +await functions.update({ + functionId: func.$id, + name: func.name, + runtime: func.runtime, + // Include other current function settings as needed. + deploymentRetention: 90 +}); + +const site = await sites.get({ + siteId: '' +}); + +await sites.update({ + siteId: site.$id, + name: site.name, + framework: site.framework, + // Include other current site settings as needed. + deploymentRetention: 30 +}); +``` + +# When to use deployment retention + +Use deployment retention when your deployment history grows faster than your need to inspect it. Every non-active deployment keeps occupying storage in your project, and those artifacts count toward the storage allowance on your [Appwrite Cloud plan](/pricing). For teams using Git-based deploys, preview deployments, frequent rebuilds, or short-lived feature branches, that footprint adds up quickly and can push you into additional storage charges for builds you would never roll back to. + +A shorter retention window works well for staging, preview, and internal environments where old builds lose value quickly and storage savings add up the fastest. A longer window fits production resources where you want more historical context for support, incident review, or rollback planning. If your compliance or operational process requires keeping every deployment, set retention to `0` and Appwrite will keep non-active deployments forever. + +# Configure deployment retention in Appwrite + +Deployment retention is available on [Appwrite Cloud](https://cloud.appwrite.io) today. You can update existing Functions and Sites from the Console, or configure the same setting through the API and Server SDKs. + +- [Configure Function deployment retention](/docs/products/functions/deployments#deployment-retention) +- [Configure Site deployment retention](/docs/products/sites/deployments#deployment-retention) +- [Functions API reference](/docs/references/cloud/server-nodejs/functions#update) +- [Sites API reference](/docs/references/cloud/server-nodejs/sites#update) diff --git a/src/routes/changelog/(entries)/2026-05-15.markdoc b/src/routes/changelog/(entries)/2026-05-15.markdoc new file mode 100644 index 00000000000..d23ceb63c5a --- /dev/null +++ b/src/routes/changelog/(entries)/2026-05-15.markdoc @@ -0,0 +1,14 @@ +--- +layout: changelog +title: "Announcing deployment retention for Functions and Sites" +date: 2026-05-15 +cover: /images/blog/announcing-deployment-retention/cover.avif +--- + +Appwrite now supports deployment retention for [Functions](/docs/products/functions/deployments#deployment-retention) and [Sites](/docs/products/sites/deployments#deployment-retention), letting you automatically delete old non-active deployments after a retention window you control. Deployment artifacts count toward your project's storage allowance on [Appwrite Cloud](/pricing), so retention reclaims that space and reduces storage overage on builds you would never roll back to. + +The active deployment is always kept. Set `deploymentRetention` to `0` to keep non-active deployments forever, or choose a day-based value up to `36500` days. You can configure it from the Console or through the Functions and Sites APIs. + +{% arrow_link href="/blog/post/announcing-deployment-retention" %} +Read the announcement +{% /arrow_link %} diff --git a/src/routes/docs/products/functions/deployments/+page.markdoc b/src/routes/docs/products/functions/deployments/+page.markdoc index 48f400c5949..8265c6d193e 100644 --- a/src/routes/docs/products/functions/deployments/+page.markdoc +++ b/src/routes/docs/products/functions/deployments/+page.markdoc @@ -59,4 +59,59 @@ Users subscribed to the Appwrite Pro plan or above receive certain special benef - [Express builds](/changelog/entry/2024-08-10) for quicker deployments, resulting in reduced wait times and smoother workflows - Longer [build timeouts](/docs/advanced/platform/compute#build-timeouts) (45 minutes vs 15 minutes on Free; Enterprise is custom) - Customizable [build and runtime specifications](/docs/advanced/platform/compute) for CPU and memory on each function -{% /info %} \ No newline at end of file +{% /info %} + +# Deployment retention {% #deployment-retention %} +Deployment retention controls how long Appwrite keeps non-active function deployments. The active deployment is always kept. When a non-active deployment is older than the configured retention period, Appwrite automatically deletes it during maintenance. Set the value to `0` to keep non-active deployments forever. + +To configure deployment retention from the Appwrite Console: + +1. Navigate to **Functions**. +2. Open the function you want to configure. +3. Go to **Settings** > **Deployment retention**. +4. Turn on **Keep deployments forever**, or turn it off and choose how long to keep non-active deployments. +5. Click **Update**. + +{% only_dark %} +![Function deployment retention settings](/images/docs/functions/dark/deployment-retention.avif) +{% /only_dark %} +{% only_light %} +![Function deployment retention settings](/images/docs/functions/deployment-retention.avif) +{% /only_light %} + +The Console provides common presets from `1 Week` to `10 Years`. When using the API or a Server SDK, set `deploymentRetention` to the number of days to keep non-active deployments. The value must be between `0` and `36500`, where `0` means unlimited retention. + +When updating a function with a Server SDK, pass the existing settings you do not intend to change and update only `deploymentRetention`. + +{% multicode %} + +```server-nodejs +const func = await functions.get({ + functionId: '' +}); + +await functions.update({ + functionId: func.$id, + name: func.name, + runtime: func.runtime, + execute: func.execute ?? undefined, + events: func.events ?? undefined, + schedule: func.schedule ?? undefined, + timeout: func.timeout ?? undefined, + enabled: func.enabled ?? undefined, + logging: func.logging ?? undefined, + entrypoint: func.entrypoint ?? undefined, + commands: func.commands ?? undefined, + scopes: func.scopes ?? undefined, + installationId: func.installationId ?? undefined, + providerRepositoryId: func.providerRepositoryId ?? undefined, + providerBranch: func.providerBranch ?? undefined, + providerSilentMode: func.providerSilentMode ?? undefined, + providerRootDirectory: func.providerRootDirectory ?? undefined, + buildSpecification: func.buildSpecification ?? undefined, + runtimeSpecification: func.runtimeSpecification ?? undefined, + deploymentRetention: 90 +}); +``` + +{% /multicode %} diff --git a/src/routes/docs/products/sites/deployments/+page.markdoc b/src/routes/docs/products/sites/deployments/+page.markdoc index ac39e33761d..428d12a4c97 100644 --- a/src/routes/docs/products/sites/deployments/+page.markdoc +++ b/src/routes/docs/products/sites/deployments/+page.markdoc @@ -83,4 +83,61 @@ Users subscribed to the Appwrite Pro plan or above receive certain special benef - [Express builds](/changelog/entry/2024-08-10) for quicker deployments, resulting in reduced wait times and smoother workflows - Longer [build timeouts](/docs/advanced/platform/compute#build-timeouts) (45 minutes vs 15 minutes on Free; Enterprise is custom) - Customizable [build and runtime specifications](/docs/advanced/platform/compute) for CPU and memory on each site -{% /info %} \ No newline at end of file +{% /info %} + +# Deployment retention {% #deployment-retention %} + +Deployment retention controls how long Appwrite keeps non-active site deployments. The active deployment is always kept. When a non-active deployment is older than the configured retention period, Appwrite automatically deletes it during maintenance. Set the value to `0` to keep non-active deployments forever. + +To configure deployment retention from the Appwrite Console: + +1. Navigate to **Sites**. +2. Open the site you want to configure. +3. Go to **Settings** > **Deployment retention**. +4. Turn on **Keep deployments forever**, or turn it off and choose how long to keep non-active deployments. +5. Click **Update**. + +{% only_dark %} +![Site deployment retention settings](/images/docs/sites/dark/deployment-retention.avif) +{% /only_dark %} +{% only_light %} +![Site deployment retention settings](/images/docs/sites/deployment-retention.avif) +{% /only_light %} + +The Console provides common presets from `1 Week` to `10 Years`. When using the API or a Server SDK, set `deploymentRetention` to the number of days to keep non-active deployments. The value must be between `0` and `36500`, where `0` means unlimited retention. + +When updating a site with a Server SDK, pass the existing settings you do not intend to change and update only `deploymentRetention`. + +{% multicode %} + +```server-nodejs +const site = await sites.get({ + siteId: '' +}); + +await sites.update({ + siteId: site.$id, + name: site.name, + framework: site.framework, + enabled: site.enabled ?? undefined, + logging: site.logging ?? undefined, + timeout: site.timeout ?? undefined, + installCommand: site.installCommand ?? undefined, + buildCommand: site.buildCommand ?? undefined, + startCommand: site.startCommand ?? undefined, + outputDirectory: site.outputDirectory ?? undefined, + buildRuntime: site.buildRuntime ?? undefined, + adapter: site.adapter ?? undefined, + fallbackFile: site.fallbackFile ?? undefined, + installationId: site.installationId ?? undefined, + providerRepositoryId: site.providerRepositoryId ?? undefined, + providerBranch: site.providerBranch ?? undefined, + providerSilentMode: site.providerSilentMode ?? undefined, + providerRootDirectory: site.providerRootDirectory ?? undefined, + buildSpecification: site.buildSpecification ?? undefined, + runtimeSpecification: site.runtimeSpecification ?? undefined, + deploymentRetention: 90 +}); +``` + +{% /multicode %} diff --git a/static/images/blog/announcing-deployment-retention/cover.avif b/static/images/blog/announcing-deployment-retention/cover.avif new file mode 100644 index 00000000000..f924e177976 Binary files /dev/null and b/static/images/blog/announcing-deployment-retention/cover.avif differ diff --git a/static/images/docs/functions/dark/deployment-retention.avif b/static/images/docs/functions/dark/deployment-retention.avif new file mode 100644 index 00000000000..34f44c5a9b9 Binary files /dev/null and b/static/images/docs/functions/dark/deployment-retention.avif differ diff --git a/static/images/docs/functions/deployment-retention.avif b/static/images/docs/functions/deployment-retention.avif new file mode 100644 index 00000000000..7b7771e16a9 Binary files /dev/null and b/static/images/docs/functions/deployment-retention.avif differ diff --git a/static/images/docs/sites/dark/deployment-retention.avif b/static/images/docs/sites/dark/deployment-retention.avif new file mode 100644 index 00000000000..e3f3b8f4dba Binary files /dev/null and b/static/images/docs/sites/dark/deployment-retention.avif differ diff --git a/static/images/docs/sites/deployment-retention.avif b/static/images/docs/sites/deployment-retention.avif new file mode 100644 index 00000000000..bdd86f588be Binary files /dev/null and b/static/images/docs/sites/deployment-retention.avif differ