Allow ENABLE_BOOTSNAP to be set to 0 to disable

This commit is contained in:
Ash McKenzie 2021-10-29 13:14:32 +11:00
parent 4ecc8ea9c8
commit cc4116aee0
No known key found for this signature in database
GPG key ID: A1253B4953E8D3E6
2 changed files with 4 additions and 2 deletions

View file

@ -1,4 +1,6 @@
# frozen_string_literal: true
require_relative 'bundler_setup'
require 'bootsnap/setup' if ENV['RAILS_ENV'] != 'production' || %w(1 yes true).include?(ENV['ENABLE_BOOTSNAP'])
enable_bootsnap_default_value = ENV['RAILS_ENV'] != 'production' ? '1' : '0'
require 'bootsnap/setup' if %w(1 yes true).include?(ENV.fetch('ENABLE_BOOTSNAP', enable_bootsnap_default_value))

View file

@ -20,7 +20,7 @@ You can use the following environment variables to override certain values:
| Variable | Type | Description |
|--------------------------------------------|---------|---------------------------------------------------------------------------------------------------------|
| `DATABASE_URL` | string | The database URL; is of the form: `postgresql://localhost/blog_development`. |
| `ENABLE_BOOTSNAP` | string | Enables Bootsnap for speeding up initial Rails boot (`1` to enable). |
| `ENABLE_BOOTSNAP` | string | Toggles [Bootsnap](https://github.com/Shopify/bootsnap) for speeding up initial Rails boot. Enabled by default for non-production environments. Set to `0` to disable. |
| `EXTERNAL_URL` | string | Specify the external URL at the [time of installation](https://docs.gitlab.com/omnibus/settings/configuration.html#specifying-the-external-url-at-the-time-of-installation). |
| `EXTERNAL_VALIDATION_SERVICE_TIMEOUT` | integer | Timeout, in seconds, for an [external CI/CD pipeline validation service](external_pipeline_validation.md). Default is `5`. |
| `EXTERNAL_VALIDATION_SERVICE_URL` | string | URL to an [external CI/CD pipeline validation service](external_pipeline_validation.md). |