Configuration Options

This section provides detailed explanations and code examples for configuring the development environment of gitlab-org/....

Environment Variables

Configuration often relies on environment variables. These can be set in your shell profile or directly in your terminal session.

export GITLAB_ENV=development
export GITLAB_HOST=localhost
export GITLAB_PORT=3000
export DATABASE_URL=postgres://user:password@localhost:5432/gitlab_development

The above variables can be added to a .env file for convenience, using the dotenv gem which loads these configurations automatically.

Database Configuration

The database configurations should be specified in the config/database.yml file. Below is an example of how to configure your development database.

development:
  adapter: postgresql
  encoding: unicode
  database: gitlab_development
  pool: 5
  username: user
  password: password
  host: localhost

Make sure to replace user and password with your actual PostgreSQL credentials.

Redis Configuration

Redis is often used for caching and background job processing. Configure Redis connection settings in the config/initializers/redis.rb.

$redis = Redis.new(
  host: 'localhost',
  port: 6379,
  db: 0
)

Ensure Redis server is running locally.

Sidekiq Configuration

If using Sidekiq for background processing, configurations can be set in config/sidekiq.yml.

:concurrency: 5
:queues:
  - default
  - mailers

Web Server Configuration

If the application is to be served via Puma, you can configure it in the config/puma.rb file.

workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count

preload_app!

rackup      DefaultRackup
port        ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'

Webpack Configuration

For managing JavaScript and styles, you might need to adjust your Webpack settings in config/webpacker.yml.

development:
  source_path: app/javascript
  public_output_path: packs
  cache_manifest: false

GitLab Shell Configuration

GitLab Shell configurations can be done in the config/gitlab.yml file to enable Git over HTTP or SSH.

gitlab_shell:
  http: false
  ssh: true

Make sure to reflect your project’s needs.

Custom Initializers

For registering any custom configurations or initializations, create a file under config/initializers/.

# config/initializers/my_custom_config.rb
MyApp::Config.setup do |config|
  config.some_setting = 'value'
end

Conclusion

Proper configuration of the development environment is crucial for effective development and testing. Each setting should be tailored to fit the local development needs.

For further details, review the specific configuration files within the project repository.