Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v3.0.0 #278

Merged
merged 9 commits into from
Dec 4, 2024
Merged
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
26 changes: 14 additions & 12 deletions docs/cli-tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,20 @@ yarn global add genezio

The genezio CLI tool supports the commands shown in the following table:

| Command | Description |
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| genezio create | Create a new fullstack project from templates [Learn more](https://genezio.com/docs/cli-tool/cli-commands/genezio-create) |
| genezio local --port `<port>` | Runs a local environment with your project for testing purposes. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/local) |
| genezio deploy | Deploys your project to the genezio infrastructure. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/deploy) |
| genezio list `[<identifier>]` | Displays details of your projects. You can view them all at once or display a particular one by providing its name or ID. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/ls) |
| genezio delete `[<project-id>]` | Deletes the project described by the provided ID. If no ID is provided, lists all the projects and IDs. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/delete) |
| genezio sdk | Generates an SDK corresponding to a deployed project. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/generatesdk) |
| genezio account | Display information about the current account logged in. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/account) |
| genezio login `<access-token>` | Authenticates with genezio platform to deploy your code. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/login) |
| genezio logout | Logout from genezio platform. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/logout) |
| genezio help / genezio `<command>` --help | Displays help for the CLI tool. |
| Command | Description |
|---------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| genezio create | Create a new fullstack project from templates [Learn more](https://genezio.com/docs/cli-tool/cli-commands/genezio-create) |
| genezio local --port `<port>` | Runs a local environment with your project for testing purposes. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/local) |
| genezio deploy | Deploys your project to the genezio infrastructure. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/deploy) |
| genezio analyze | Analyzes the current directory's infrastructure setup. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/analyze) |
| genezio list `[<identifier>]` | Displays details of your projects.[Learn more](https://genezio.com/docs/cli-tool/cli-commands/ls) |
| genezio delete `[<project-id>]` | Deletes a specific project. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/delete) |
| genezio sdk | Generates an SDK corresponding to a deployed project. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/generatesdk) |
| genezio account | Display information about the current account logged in. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/account) |
| genezio login `<access-token>` | Authenticates with genezio platform to deploy your code. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/login) |
| genezio logout | Logout from genezio platform. [Learn more](https://genezio.com/docs/cli-tool/cli-commands/logout) |
| genezio help | Displays help for the CLI tool. |
| genezio `<command>` --help | Displays help for a specific command. |

## CLI Environment Variables

Expand Down
1 change: 1 addition & 0 deletions docs/cli-tool/cli-commands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Below you can see a list of the most useful commands:
| genezio deploy | Deploy a project to the cloud. [Learn more](./deploy) |
| genezio deploy --frontend | Deploy the frontend to the genezio cloud. [Learn more](./deploy) |
| genezio deploy --backend | Deploy the backend to the genezio cloud. [Learn more](./deploy) |
| genezio analyze | Analyze the current directory's infrastructure setup. [Learn more](./analyze) |
| genezio create | Create a new starter project, in an interactive way. [Learn more](./genezio-create) |
| genezio sdk | Generate an SDK for a deployed or local project. [Learn more](./generatesdk) |
| genezio ls | List details on deployed projects [Learn more](./ls) |
Expand Down
34 changes: 34 additions & 0 deletions docs/cli-tool/cli-commands/analyze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
sidebar_position: 11
description: Learn how to analyze your current directory's infrastructure setup with the genezio analyze command.
---

# genezio analyze

<head>
<title>genezio analyze CLI Command | Genezio Documentation</title>
</head>

### Usage

`genezio analyze [--config <config>] [--format <format>] [-h | --help]`

### Description

This command analyzes the current directory to determine its infrastructure setup. It generates a `genezio.yaml` file based on the detected configuration. This file helps in managing and deploying your project using Genezio's serverless platform.

If a specific configuration file is provided using the `--config` option, the command will update the detected setup accordingly.

### Options

`--config <config>`: Use a specific `genezio.yaml` file to update the detected setup. The default value is `./genezio.yaml`.

`--format <format>`: Specify the output format of the analysis results. Supported values are:
- `json`: Outputs the analysis results in JSON format. This format is typically used programmatically to process or integrate the detected infrastructure details with other tools or systems.
- `list`: Produces a plain list of the detected infrastructure components. Like `json`, this format is commonly used programmatically or for quick inspection in scripts.
- `markdown`: Generates the results as a Markdown document. This format is ideal for creating a documentation page that describe the detected infrastructure in a human-readable manner.
- `text` (default): Provides a plain text summary of the analysis results.

`--logLevel <logLevel>`: Set the verbosity of the output. The supported values are: `trace/debug/info/warn/error`. If you don't specify this argument, the default value used is `info`.

`-h | --help`: Display a help message for more information on each argument and how to use it.
71 changes: 71 additions & 0 deletions docs/features/cron-jobs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
description: A scheduled method or a cron job is a function that will run periodically. By using a specific syntax, you can define the frequency and timing for each method.
---

# Crons

<head>
<title>Crons | Genezio Documentation</title>
</head>

A scheduled method or a cron job is a function that will run periodically. By using a specific cron syntax, you can define the frequency and timing for each method. You can use Genezio functions to define cron jobs in your project.

## Create a cron job

To create a cron job, you will need a function that will run periodically. You can define the function in your code and then add the cron job in the configuration file. To learn more about Genezio functions, check the [functions documentation](../tutorials/how-to-deploy-a-serverless-function.md).

```yaml title="genezio.yaml"
name: cron-getting-started
region: us-east-1
yamlVersion: 2
backend:
path: ./
language:
name: js
packageManager: npm
functions:
- name: my-function
path: ./
handler: handler
entry: app.mjs
services:
crons:
- name: my-cron
function: ${{backend.functions.my-function.name}}
schedule: "* * * * *"
endpoint: "/my-cron"
```

This configuration file specifies the project name, deployment region, and details about the backend. It also specifies the cron job name, the name of function that will called, the schedule, and the endpoint. In this example, the cron job will run every minute and will call the url provided by your backend function at the specifed endpoint. The `endpoint` field is optional, if it is not provided, the cron job will call the base url of your function.

If you want to learn more about cron strings and how to define a valid schedule, check https://crontab.guru/.

:::info
You can also specify the function name manually like so:

```yaml title="genezio.yaml"
services:
crons:
- name: my-cron
function: my-function
schedule: "* * * * *"
endpoint: "/my-cron"
```

:::

## Testing

### Local

To test your crons locally you can simply run `genezio local` and check the terminal logs to see if the cron job is being executed.

### Remote

:::warning
Deploying your project will **sync** the state of the crons with what is in the `genezio.yaml` file. This means that if you delete a cron job from the file and deploy the project, it will be deleted from the cloud as well. Before deploying, make sure that the state provided in the `genezio.yaml` file is your desired output state after deployment.
:::

Simply run `genezio deploy` to deploy your project.

To test if your cron job was succesfully created, you can check the logs of the function that the cron job is calling to see if it is being executed.
2 changes: 1 addition & 1 deletion docs/frameworks/django.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Django is a popular Python web application framework that simplifies the develop
provides a robust set of features for building web servers and APIs.

:::tip
Get started in no time with the [Django template](https://app.genez.io/start/deploy?repository=https://github.com/Genez-io/django-getting-started))
Get started in no time with the [Django template](https://app.genez.io/start/deploy?repository=https://github.com/Genez-io/django-getting-started)
:::

# Deployment
Expand Down
2 changes: 1 addition & 1 deletion docs/frameworks/fastapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import TabItem from '@theme/TabItem';
FastAPI is a modern Python web application framework that simplifies the development of server-side applications. It provides a robust set of features for building web servers and APIs.

:::tip
Get started in no time with the [FastAPI template](https://app.genez.io/start/deploy?repository=https://github.com/Genez-io/fastapi-getting-started)).
Get started in no time with the [FastAPI template](https://app.genez.io/start/deploy?repository=https://github.com/Genez-io/fastapi-getting-started).
:::

# Deployment
Expand Down
2 changes: 1 addition & 1 deletion docs/frameworks/flask.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Flask is a popular Python web application framework that simplifies the developm
provides a robust set of features for building web servers and APIs.

:::tip
Get started in no time with the [Flask template](https://app.genez.io/start/deploy?repository=https://github.com/Genez-io/flask-getting-started)).
Get started in no time with the [Flask template](https://app.genez.io/start/deploy?repository=https://github.com/Genez-io/flask-getting-started).
:::

# Deployment
Expand Down
2 changes: 1 addition & 1 deletion docs/genezio-typesafe/cron-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The time specified in the cron strings is in UTC. You can use this [converter](h

## Use scheduled methods in your project

There are two ways to declare a scheduled method:
There are two ways to declare a scheduled method in a Genezio typsafe project:

- Using decorators (only available for TypeScript, JavaScript and Go projects)
- Using the `genezio.yaml` configuration file (available for all supported languages, including TypeScript, JavaScript, Go)
Expand Down
Loading
Loading