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

[Bug?]: Process for deploying to render no longer matches documentation #11703

Open
1 task
tctrautman opened this issue Oct 19, 2024 · 1 comment
Open
1 task
Labels
bug/needs-info More information is needed for reproduction

Comments

@tctrautman
Copy link
Contributor

What's not working?

Hello!

I've deployed a handful of Redwood apps to render over the last few years, and just tried to again yesterday but the process found in documentation no longer seems to line up with the CLI.

Specifically, when you run yarn rw setup deploy render you are now asked to pick a side to deploy:

> yarn rw setup deploy render
rw setup deploy render <side>

Build, migrate, and serve command for Render deploy

Positionals:
  side  Side to deploy               [string] [required] [choices: "api", "web"]

Options:
      --cwd                 Working directory to use (where `redwood.toml` is
                            located)
      --load-env-files      Load additional .env files. Values defined in files
                            specified later override earlier ones.       [array]
      --telemetry           Whether to send anonymous usage telemetry to
                            RedwoodJS                                  [boolean]
      --version             Show version number                        [boolean]
  -f, --force               Overwrite existing configuration
                                                      [boolean] [default: false]
      --prisma              Apply database migrations  [boolean] [default: true]
      --data-migrate, --dm  Apply data migrations      [boolean] [default: true]
  -h, --help                Show help                                  [boolean]

For more commands, options, and examples, see Redwood CLI Reference

Not enough non-option arguments: got 0, need at least 1

In the past, and detailed further in Render's documentation, this would have created a render.yaml file that would have made it easy to deploy both the api and web sides within Render, and (I believe) create a healthz function that render would use to check on the API side.

I'm not sure which process is preferred, the process detailed in the CLI or the process in the documentation. But right now the conflicting guidance makes it unclear how to proceed.

If the process detailed in the CLI is preferred (it is the more-recently updated than the docs,) then it would be helpful if the documentation was updated to detail what's necessary to get the web side to successfully send requests to the api side after deploying each side independently.

How do we reproduce the bug?

yarn rw setup deploy render

What's your environment? (If it applies)

No response

Are you interested in working on this?

  • I'm interested in working on this
@tctrautman tctrautman added the bug/needs-info More information is needed for reproduction label Oct 19, 2024
@tctrautman
Copy link
Contributor Author

In case anyone stumbles onto this issue and needs to be unblocked, the fix for me was to to manually:

  1. Create a render.yaml file in the root of my directory (the contents of the file I used are below)
  2. Create a healthz.js (notice that it's a .js file, despite my repo being Typescript) file with the contents below

Note that I'm using another provider for my DB. You'll need to refer to render's documentation for how to use them for a postgres database if that's your plan.

render.yaml:

services:
- name: [THE_NAME_OF_YOUR_WEB_SERVICE]
  type: web
  env: static
  buildCommand: corepack enable && yarn install && yarn rw deploy render web
  staticPublishPath: ./web/dist

  envVars:
  - key: SKIP_INSTALL_DEPS
    value: true

  routes:
  - type: rewrite
    source: /.redwood/functions/*
    destination: https://api.contentcalibrator.com/*
  - type: rewrite
    source: /*
    destination: /index.html

- name: [THE_NAME_OF_YOUR_API_SERVICE]
  type: web
  env: node
  region: oregon
  buildCommand: corepack enable && yarn install && yarn rw build api
  startCommand: yarn rw deploy render api

The content of healthz.js:

// render-health-check
export const handler = async () => {
  return {
    statusCode: 200,
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction
Projects
None yet
Development

No branches or pull requests

1 participant