From b99b4b13c46c78b99f9b4b07af77b8306acf6066 Mon Sep 17 00:00:00 2001 From: Arjun Aditya Date: Fri, 29 Nov 2024 00:42:43 +0530 Subject: [PATCH] New Component for Runtimes --- apps/docs/content/features/access.mdx | 24 +++--- apps/docs/content/features/env-variables.mdx | 19 +++-- apps/docs/content/features/pipeline.mdx | 73 ++++++++++++------- .../content/nginx/how-to/build-pipeline.mdx | 33 +++------ apps/docs/content/references/zeropsyml.mdx | 23 +++--- apps/docs/src/components/GroupCards/index.tsx | 36 +++++++++ 6 files changed, 132 insertions(+), 76 deletions(-) create mode 100644 apps/docs/src/components/GroupCards/index.tsx diff --git a/apps/docs/content/features/access.mdx b/apps/docs/content/features/access.mdx index e403090e..50f86e4e 100644 --- a/apps/docs/content/features/access.mdx +++ b/apps/docs/content/features/access.mdx @@ -4,6 +4,18 @@ description: Explore how you can work with subdomains, custom domains and ip acc --- import Image from '/src/components/Image'; +import GroupCards from '../../src/components/GroupCards' + +export const languages = [ + { name: "Node.js", link: "/nodejs/how-to/build-pipeline#ports" }, + { name: "Go", link: "/go/how-to/build-pipeline#ports" }, + { name: "Java", link: "/java/how-to/build-pipeline#ports" }, + { name: "PHP", link: "/php/how-to/build-pipeline#ports" }, + { name: ".NET", link: "/dotnet/how-to/build-pipeline#ports" }, + { name: "Rust", link: "/rust/how-to/build-pipeline#ports" }, + { name: "Python", link: "/python/how-to/build-pipeline#ports" }, +] + Zerops offers 3 different ways how to access your application from the internet: @@ -14,15 +26,9 @@ Zerops offers 3 different ways how to access your application from the internet: ## Public access through zerops.app subdomain By default, your runtime service is not publicly accessible. -To test your application, you can enable public access through zerops.app subdomain. Go to the service detail page in Zerops GUI and select **Public access & internal ports** in the left menu. Then toggle the **Zerops subdomain access** switch. Zerops will assign the unique zerops.app subdomain for your application. If you have defined more internal ports with http support in your zerops.yml, Zerops will create the unique zerops.app subdomain for each port. Learn more about how to define internal ports for your runtime: - -- [Node.js](/nodejs/how-to/build-pipeline#ports) -- [PHP](/php/how-to/build-pipeline#ports) -- [Python](/python/how-to/build-pipeline#ports) -- [Go](/go/how-to/build-pipeline#ports) -- [.NET](/dotnet/how-to/build-pipeline#ports) -- [Rust](/rust/how-to/build-pipeline#ports) -- [Java](/java/how-to/build-pipeline#ports) +To test your application, you can enable public access through zerops.app subdomain. Go to the service detail page in Zerops GUI and select **Public access & internal ports** in the left menu. Then toggle the **Zerops subdomain access** switch. Zerops will assign the unique zerops.app subdomain for your application. If you have defined more internal ports with http support in your zerops.yml, Zerops will create the unique zerops.app subdomain for each port. + +

## Environment variables with the same key diff --git a/apps/docs/content/features/pipeline.mdx b/apps/docs/content/features/pipeline.mdx index f21aa4a3..a627bc73 100644 --- a/apps/docs/content/features/pipeline.mdx +++ b/apps/docs/content/features/pipeline.mdx @@ -3,8 +3,48 @@ title: Build & deploy pipeline description: Learn how to setup a build & deploy pipeline at Zerops. --- +import GroupCards from '../../src/components/GroupCards'; import Image from '/src/components/Image'; +export const languages = [ + { name: "Node.js", link: "/nodejs/how-to/env-variables#how-to-read-env-variables-from-your-nodejs-app" }, + { name: "PHP", link: "/php/how-to/env-variables#how-to-read-env-variables-from-your-php-app" }, + { name: "Python", link: "/python/how-to/env-variables#how-to-read-env-variables-from-your-python-app" }, + { name: "Go", link: "/go/how-to/env-variables#how-to-read-env-variables-from-your-go-app" }, + { name: ".NET", link: "/dotnet/how-to/env-variables#how-to-read-env-variables-from-your-dotnet-app" }, + { name: "Rust", link: "/rust/how-to/env-variables#how-to-read-env-variables-from-your-rust-app" } +] + +export const builds = [ + { name: "Node.js", link: "/nodejs/how-to/build-process##nodejs-build-hardware-resources" }, + { name: "PHP", link: "/php/how-to/build-process#php-build-hardware-resources" }, + { name: "Python", link: "/python/how-to/build-process#python-build-hardware-resources" }, + { name: "Go", link: "/go/how-to/build-process#go-build-hardware-resources" }, + { name: ".NET", link: "/dotnet/how-to/build-process#dotnet-build-hardware-resources" }, + { name: "Rust", link: "/rust/how-to/build-process#rust-build-hardware-resources" }, + { name: "Java", link: "/java/how-to/build-process#java-build-hardware-resources" }, +] + +export const customiseBuild = [ + { name: "Node.js", link: "/nodejs/how-to/build-process#customise-nodejs-build-environment" }, + { name: "PHP", link: "/php/how-to/build-process#customise-php-build-environment" }, + { name: "Python", link: "/python/how-to/build-process#customise-python-build-environment" }, + { name: "Go", link: "/go/how-to/build-process#customise-go-build-environment" }, + { name: ".NET", link: "/dotnet/how-to/build-process#customise-dotnet-build-environment" }, + { name: "Rust", link: "/rust/how-to/build-process#customise-rust-build-environment" }, + { name: "Java", link: "/java/how-to/build-process#customise-java-build-environment" }, +] + +export const customiseRuntime = [ + { name: "Node.js", link: "/nodejs/how-to/customize-runtime" }, + { name: "PHP", link: "/php/how-to/customize-runtime" }, + { name: "Python", link: "/python/how-to/customize-runtime" }, + { name: "Go", link: "/go/how-to/customize-runtime" }, + { name: ".NET", link: "/dotnet/how-to/customize-runtime" }, + { name: "Rust", link: "/rust/how-to/customize-runtime" }, + { name: "Java", link: "/java/how-to/customize-runtime" }, +] + ## Configure the pipeline Zerops provides a customizable build and runtime environment for your application. @@ -40,13 +80,7 @@ Zerops will follow these instruction when the build & deploy pipeline is trigger Learn more about all `zerops.yml` parameters for your runtime: -- [Node.js](/nodejs/how-to/build-pipeline) -- [PHP](/php/how-to/build-pipeline) -- [Python](/python/how-to/build-pipeline) -- [Go](/go/how-to/build-pipeline) -- [.NET](/dotnet/how-to/build-pipeline) -- [Rust](/rust/how-to/build-pipeline) -- [Java](/java/how-to/build-pipeline) + ## Trigger the pipeline @@ -132,13 +166,8 @@ The build container is automatically deleted after the build has finished or fai Each runtime service have different HW resources for build containers: -- [Node.js](/nodejs/how-to/build-process##nodejs-build-hardware-resources) -- [PHP](/php/how-to/build-process#php-build-hardware-resources) -- [Python](/python/how-to/build-process#python-build-hardware-resources) -- [Go](/go/how-to/build-process#go-build-hardware-resources) -- [.NET](/dotnet/how-to/build-process#dotnet-build-hardware-resources) -- [Rust](/rust/how-to/build-process#rust-build-hardware-resources) -- [Java](/java/how-to/build-process#java-build-hardware-resources) + + The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources. @@ -157,13 +186,7 @@ To install additional packages or tools add one or more [build.prepareCommands]( Learn more about what is included in the default build environment: -- [Node.js](/nodejs/how-to/build-process#customise-nodejs-build-environment) -- [PHP](/php/how-to/build-process#customise-php-build-environment) -- [Python](/python/how-to/build-process#customise-python-build-environment) -- [Go](/go/how-to/build-process#customise-go-build-environment) -- [.NET](/dotnet/how-to/build-process#customise-dotnet-build-environment) -- [Rust](/rust/how-to/build-process#customise-rust-build-environment) -- [Java](/java/how-to/build-process#customise-java-build-environment) + ## Deploy phase @@ -248,13 +271,7 @@ To install additional packages or tools add one or more [run.prepareCommands](/r Learn more about what is included in the default runtime environment: -- [Node.js](/nodejs/how-to/customize-runtime) -- [PHP](/php/how-to/customize-runtime) -- [Python](/python/how-to/customize-runtime) -- [Go](/go/how-to/customize-runtime) -- [.NET](/dotnet/how-to/customize-runtime) -- [Rust](/rust/how-to/customize-runtime) -- [Java](/java/how-to/customize-runtime) +

If you just need to deploy your static content, use the [manual deploy](/nginx/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) via Zerops CLI. @@ -106,20 +111,6 @@ zerops: Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Nginx application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section. -## Build pipeline configuration - -Zerops supports different build environments: - -- [Node.js](/nodejs/how-to/build-pipeline) -- [PHP](/php/how-to/build-pipeline) -- [Python](/python/how-to/build-pipeline) -- [Go](/go/how-to/build-pipeline) -- [.NET](/dotnet/how-to/build-pipeline) -- [Rust](/rust/how-to/build-pipeline) -- [Java](/java/how-to/build-pipeline) - -If you just need to deploy your static content, use the [manual deploy](/nginx/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) via Zerops CLI. - ## Runtime configuration ### base diff --git a/apps/docs/content/references/zeropsyml.mdx b/apps/docs/content/references/zeropsyml.mdx index 007e663f..3ea937d2 100644 --- a/apps/docs/content/references/zeropsyml.mdx +++ b/apps/docs/content/references/zeropsyml.mdx @@ -5,22 +5,25 @@ description: Learn how you can configure your zerops yaml and use the available import data from '@site/static/data.json'; import UnorderedCodeList from '@site/src/components/UnorderedCodeList'; +import GroupCards from '@site/src/components/GroupCards'; + +export const languages = [ + { name: "Node.js", link: "/nodejs/how-to/build-pipeline" }, + { name: "PHP", link: "/php/how-to/build-pipeline" }, + { name: "Python", link: "/python/how-to/build-pipeline" }, + { name: "Go", link: "/go/how-to/build-pipeline" }, + { name: ".NET", link: "/dotnet/how-to/build-pipeline" }, + { name: "Rust", link: "/rust/how-to/build-pipeline" }, + { name: "Java", link: "/java/how-to/build-pipeline" }, + { name: "Nginx", link: "/nginx/how-to/build-pipeline" } +] The `zerops.yml` file is crucial for defining how Zerops should [build and deploy](/features/pipeline) your application. Add the `zerops.yml` file to the **root of your repository** and customize it to suit your application's needs. --- -## Quick Links to Runtime-Specific Guides - -- [Node.js](/nodejs/how-to/build-pipeline) -- [PHP](/php/how-to/build-pipeline) -- [Python](/python/how-to/build-pipeline) -- [Go](/go/how-to/build-pipeline) -- [.NET](/dotnet/how-to/build-pipeline) -- [Rust](/rust/how-to/build-pipeline) -- [Java](/java/how-to/build-pipeline) -- [nginx static](/nginx/how-to/build-pipeline) + ## Basic Structure diff --git a/apps/docs/src/components/GroupCards/index.tsx b/apps/docs/src/components/GroupCards/index.tsx new file mode 100644 index 00000000..02d4858a --- /dev/null +++ b/apps/docs/src/components/GroupCards/index.tsx @@ -0,0 +1,36 @@ +import React from "react"; + +interface CardItem { + name: string; + link: string; +} + +interface GroupCardsProps { + emoji?: string; + heading: string; + items: CardItem[]; +} + +const GroupCards: React.FC = ({ items, heading, emoji }) => { + return ( +

+
+ {emoji} + {heading} +
+
+ {items.map((item, index) => ( + + {item.name} + + ))} +
+
+ ); +}; + +export default GroupCards; \ No newline at end of file