Skip to content

Commit

Permalink
add pre-installed packages section
Browse files Browse the repository at this point in the history
  • Loading branch information
aninibread committed Sep 19, 2024
1 parent 8b063cc commit 1f931e9
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 29 deletions.
6 changes: 3 additions & 3 deletions src/content/docs/pages/configuration/build-image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ When your build starts, if not already [cached](/pages/configuration/build-cachi

To override default versions of languages and tools in the build system, you can either set the desired version through environment variables or by adding files to your project.

To set the version using **environment variables**, you can:
To set the version using environment variables, you can:

1. Find the environment variable name for the language or tool in [this table](/pages/configuration/build-image/#supported-languages-and-tools).
2. Add the environment variable on the dashboard by going to **Settings** > **Environmnet variables** in your Pages project, or [add the environment variable via Wrangler](/workers/configuration/environment-variables/#add-environment-variables-via-wrangler).

Or, to set the version by **adding a file** to your project, you can:
Or, to set the version by adding a file to your project, you can:

1. Find the environment variable name for the language or tool in [this table](/pages/configuration/build-image/#supported-languages-and-tools).
1. Find the file name for the language or tool in [this table](/pages/configuration/build-image/#supported-languages-and-tools).
2. Add the specified file name to the root directory of your project, and add the desired version number as the contents of the file.

For example, if you were previously relying on the default version of Node.js in the v1 build system, to migrate to v2, you must specify that you need Node.js `12.18.0` by setting a `NODE_VERSION = 12.18.0` environment variable or by adding a `.node-version` or `.nvmrc` file to your project with `12.18.0` added as the contents to the file.
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/workers/ci-cd/builds/build-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Build settings can be found on the Settings page of your Worker. The following o
- **Git branch**
- Select the branch you would like Cloudflare to listen to for new commits. This will be defaulted to main.
- **Build command** _(Optional)_
- Add a build command if your project requires a build step. This is necessary, for example, when building with assets.
- Add a build command if your project requires a build step. This is necessary, for example, when building with assets.
- **Deploy command**
- The deploy command lets you choose the specific Wrangler command you would like to use to deploy your Worker. Your deploy command is defaulted to `npx wrangler deploy`, but it can be customized as needed. You can also upload as a version and take advantage of [gradual deployments](/workers/configuration/versions-and-deployments/gradual-deployments/).
- **Root Directory** _(Optional)_
- Specify the root directory of your Worker. The root directory describes where the build command will run.
- **API Key** _(Optional)_
- By default, Cloudflare will generate an API token for your account or you can create and select an existing API token from a previous build in the API token drop down. These API tokens will be created with the following permissions for your account:
- By default, Cloudflare will generate an API token for your account. Alternatively, you can create and select an existing API token from a previous build in the API token drop down. These API tokens will be created with the following permissions for your account:
- **Account:** Account Settings (read), Workers Scripts (edit), Workers KV Storage (edit), Workers R2 Storage (edit)
- **Zone:** Workers Routes (edit) for all zones on the account
- **User:** User Details (read), Memberships (read)
Expand Down
54 changes: 35 additions & 19 deletions src/content/docs/workers/ci-cd/builds/build-image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ The build environment has broad support for a variety of languages, such as Ruby

If you need to use a [specific version](/workers/ci-cd/builds/build-image/#overriding-default-versions) of a language, (for example, Node.js or Ruby) you can specify it by providing an associated environment variable in your build configuration, or setting the relevant file in your source code.

## Supported Languages and Tools
## Supported languages and tools

In the following tables, review the preinstalled versions for languages and tools included in the Cloudflare Workers' build image, and the environment variables and/or files available for [overriding the preinstalled version](/workers/ci-cd/builds/build-image/#overriding-default-versions):
In the following table, review the preinstalled versions for languages and tools included in the Cloudflare Workers' build image, and the environment variables and/or files available for [overriding the preinstalled version](/workers/ci-cd/builds/build-image/#overriding-default-versions):

| Tool | Default version | Supported versions | Environment variable | File |
| ----------- | ---------------- | ------------------ | -------------------- | ---------------------------- |
Expand All @@ -25,7 +25,39 @@ In the following tables, review the preinstalled versions for languages and tool
Under Supported versions, "Any version" refers to support for all versions of the language or tool including versions newer than the Default version.
:::

### Frameworks
### Overriding default versions

To override default versions of languages and tools in the build system, you can either set the desired version through environment variables or by adding files to your project.

To set the version using environment variables, you can:

1. Find the environment variable name for the language or tool.
2. Add the environment variable on the dashboard by going to **Settings** > **Environmnet variables** in your Workers project, or [add the environment variable via Wrangler](/workers/configuration/environment-variables/#add-environment-variables-via-wrangler).

Or, to set the version by adding a file to your project, you can:

1. Find the file name for the language or tool.
2. Add the specified file name to the root directory of your project and add the desired version number as the contents of the file.

For example, if you were previously relying on the default version of Node.js in the v1 build system, to migrate to v2, you must specify that you need Node.js `12.18.0` by setting a `NODE_VERSION = 12.18.0` environment variable or by adding a `.node-version` or `.nvmrc` file to your project with `12.18.0` added as the contents to the file.

## Pre-installed packages

In the following table, review the pre-installed packages in the build image. The packages are installed with `apt`, a package manager for Linux distributions.

| | | |
| ----------------- | ----------------- | ----------------- |
| `curl` | `libbz2-dev` | `libreadline-dev` |
| `git` | `libc++1` | `libssl-dev` |
| `git-lfs` | `libdb-dev` | `libvips-dev` |
| `unzip` | `libgdbm-dev` | `libyaml-dev` |
| `autoconf` | `libgdbm6` | `tzdata` |
| `build-essential` | `libgbm1` | `wget` |
| `bzip2` | `libgmp-dev` | `zlib1g-dev` |
| `gnupg` | `liblzma-dev` | `zstd` |
| `libffi-dev` | `libncurses5-dev` | |

## Framework support

To use a specific version of a framework, specify it in the project's package manager configuration file.
For example, if you use Gatsby, your `package.json` should include the following:
Expand All @@ -38,22 +70,6 @@ For example, if you use Gatsby, your `package.json` should include the following

When your build starts, version 5.13.7 of Gatsby will be installed using `npm install`.

## Overriding default versions

To override default versions of languages and tools in the build system, you can either set the desired version through environment variables or by adding files to your project.

To set the version using **environment variables**, you can:

1. Find the environment variable name for the language or tool in [this table]().
2. Add the environment variable on the dashboard by going to **Settings** > **Environmnet variables** in your Workers project, or [add the environment variable via Wrangler](/workers/configuration/environment-variables/#add-environment-variables-via-wrangler).

Or, to set the version by **adding a file** to your project, you can:

1. Find the environment variable name for the language or tool in [this table]().
2. Add the specified file name to the root directory of your project and add the desired version number as the contents of the file.

For example, if you were previously relying on the default version of Node.js in the v1 build system, to migrate to v2, you must specify that you need Node.js `12.18.0` by setting a `NODE_VERSION = 12.18.0` environment variable or by adding a `.node-version` or `.nvmrc` file to your project with `12.18.0` added as the contents to the file.

## Build Environment

Cloudflare Workers builds are run in the following environment:
Expand Down
5 changes: 1 addition & 4 deletions src/content/docs/workers/ci-cd/builds/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Connect your existing Worker to a GitHub or GitLab repository to set up automati
To set up your Git integration with a Worker:

1. **Select your Worker** in the Dashboard and navigate to the Build settings of your Worker under the Settings tab.
2. **Select the Git provider** youd like to connect to by selecting "Connect". Follow the prompts to install the Cloudflare application on your git account.
2. **Select the Git provider** you'd like to connect to by selecting "Connect". Follow the prompts to install the Cloudflare application on your git account.
3. **Configure your build settings** by selecting your desired git repository, branch and configuring a deploy command.
4. **Push a commit** to your repository to trigger your first build and deploy.

Expand All @@ -36,6 +36,3 @@ In Closed Beta, the following limits are applicable for Workers Builds:
| **Concurrent Builds** | Number of builds that run in parallel across an account. | 1 |
| **Build Timeout** | The amount of minutes that a build can be run before it is interrupted and failed. | 20 mins |

## Pricing

xyz
2 changes: 1 addition & 1 deletion src/content/docs/workers/ci-cd/builds/troubleshoot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Troubleshooting
description: Learn about troubleshooting and known issues in Workers Builds.
---

## Troubleshooting & Debugging
## Debugging

- **Updating API Tokens:** If you have updated an API Token, the changes may not be reflected in the Build Configuration settings on the dashboard. If you are encountering authentication errors after updating your build's API Token, we recommend creating a new API Token for the build.
- **Failed Builds stuck in In-Progress:** If your build has failed but the status still show that the build is "In-progress", you should cancel the build, review your build configuration, then retry the build.
Expand Down

0 comments on commit 1f931e9

Please sign in to comment.