forked from samueleaton/sentry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds
Sentry::Config
for managing configuration; Checks `.sentry.yml…
…` on startup * Add `Sentry::Config` for managing configuration, and check for `.sentry.yml`. This commit introduces `Sentry::Config` as a single object to manage the configuration of a `sentry` instance. The CLI also now checks for a `.sentry.yml` file in the project directory to load configurations automatically. These configurations can still be overwritten by specifying options the command line, though this is now entirely optional, as all options are supported from the YAML file. An example and explanation of the `.sentry.yml` format can be found in `.sentry.example.yml`. * Allow users to specify a config file with `-c` or `--config` * Rename `process_name` to `display_name`. Use name from shard for default build/run commands. * Only set `display_name` on merge if it was explicitly set on `other`. The default getter falls back to the shard name, and because the conditional for merging `display_name` only checked that this was truthy, it would always be set to whatever `other` had as a `display_name`, or the shard name (never keeping its own value). * Track whether config explicitly sets `build` and `run` commands. Similar to `display_name` before, `build` and `run` were also being overwritten when merging configs because of their default values. This commit adds more boolean properties to `Sentry::Config` to track whether the `build` and `run` commands have been explicitly set, rather than using the default value. These booleans are used in `merge!` to decide whether the config being merged in should apply its `build` and `run` commands to the receiving config.
- Loading branch information
1 parent
c7b8d99
commit 40a9685
Showing
3 changed files
with
212 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This file is used to override the default Sentry configuration without | ||
# having to specify the options on the command line. | ||
# | ||
# All configuration options in this file are optional, and will fall back | ||
# to the default values that Sentry determines based on your `shard.yml`. | ||
# | ||
# Options passed through the command line will override these settings. | ||
|
||
# The name of your application when displayed in log output. By default, this | ||
# is the app name specified in `shard.yml`. | ||
display_name: my-program-name | ||
|
||
# Set this to `true` to show configuration information when starting Sentry. | ||
info: true | ||
|
||
# The command used to compile the application. Setting this option to `nil` or | ||
# an empty string will act like specifying `--no-build` on the command line. | ||
build: crystal build ./src/sentry_cli.cr -o ./my-program-name | ||
|
||
# Any additional arguments to pass to the build command. Build args may only | ||
# be given if the build command is a single argument. | ||
build_args: | ||
|
||
# The command used to run the compiled application. | ||
run: ./my-program-name | ||
|
||
# Any additional arguments to pass to the run command. Run args may only be | ||
# given if the run command is a single argument. | ||
run_args: | ||
|
||
# The list of patterns of files for sentry to watch. | ||
watch: | ||
- ./src/**/*.cr | ||
- ./src/**/*.ecr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters