- --build-command=COMMAND need specify the build command without args, e.g. crystal
In the configuration file, the corresponding
buildhas been changed tobuild_command - --build-args=ARGS need specify build string but without the command part, e.g.
build src/sentry_cli.cr -o bin/sentryIn the configuration file, the correspondingbuildhas been changed tobuild_args - The
-bis still keep for backwards compatibility, but without the long-command form, using--src=src/foo.cris always recommended when there is noshard.yml. - When build crystal program, if a valid shard.yml was found, will create run command binary in the
./binfolder instead of in the project root(./) respect the rule ofshards build.
- Many bugs get fixed.
- sentry will play a audio file when build success/fail, individually. (Linux only)
- now, configuration file support settings all options, except
--src, latter tend to use in command line only, instead of setting--build-commandand--build-argsor-bwhen there is noshard.ymlexists.
Build/Runs your crystal application, watches files, and rebuilds/reruns app on file changes
Download released binary from release page, run it!
You don't need to set any options if you're using the shards to manage build.
╰──➤ $ sentry
🤖 Your SentryBot is vigilant. beep-boop...
🤖 watching file: ./src/daka/version.cr
🤖 watching file: ./src/daka.cr
🤖 watching file: ./src/records.ecr
🤖 compiling daka...
🤖 starting daka...
[development] Kemal is ready to lead at http://0.0.0.0:3000If you are don't use shards, specify the entry path for the main crystal file use --src should enough.
sentry --src=src/sentry.crFor the detailed usage, please check following command-line help or check .sentry.example.yml
Usage: ./sentry [options]
-n NAME, --name=NAME Sets the display name of the app process (default: sentry)
--src=PATH Sets the entry path for the main crystal file inferred from shard.yml (default: src/sentry_cli.cr)
--build-command=COMMAND Overrides the default build command (default: crystal)
--build-args=ARGS Specifies arguments for the build command (default: build src/sentry_cli.cr -o ./bin/sentry)
-b FULL_COMMAND Set both `BUILD COMMAND' and `BUILD ARGS', for backwards compatibility (default: crystal build src/sentry_cli.cr -o ./bin/sentry)
--no-build Skips the build step
-r COMMAND, --run=COMMAND Overrides the default run command inferred from shard.yml (default: ./bin/sentry)
--run-args=ARGS Specifies arguments for the run command, (default: '')
-w FILE, --watch=FILE Appends to list of watched files, (will overrides default: ["./src/**/*.cr", "./src/**/*.ecr"])
-c FILE, --config=FILE Specifies a file to load for automatic configuration (default: .sentry.yml)
--install Run `shards install' once before running Sentry build and run commands
--no-color Removes colorization from output
--not-play-audio Skips the attempt to play audio file with `aplay' from `alsa-utils' package when building on Linux succeeds or fails
-i, --info Shows the configuration informations
-V, --version Shows version
-h, --help Show this help./sentry -w "./src/**/*.cr" -w "./lib/**/*.cr"By specifying files to watch, the default will be omitted. So if you want to watch all of the file in your src directory, you will need to specify that like in the above example.
This shows the values for the build command, run command, and watched files.
🤖 Sentry configuration:
display name: sentry
shard name: sentry
src_path: src/sentry_cli.cr
build_command: crystal
build_args: build src/sentry_cli.cr -o ./bin/sentry
run_command: ./bin/sentry
run_args:
watched files: ["./src/**/*.cr", "./src/**/*.ecr"]
colorize: true
run shards install: false
should play audio: true
should build: true
should print info: true
🤖 Your SentryBot is vigilant. beep-boop...
🤖 watching file: ./src/sentry/process_runner.cr
🤖 watching file: ./src/sentry/config.cr
🤖 watching file: ./src/sentry/sound_file_storage.cr
🤖 watching file: ./src/sentry.cr
🤖 watching file: ./src/sentry_cli.cr
🤖 compiling sentry...
🤖 starting sentry...If you prefer granularity, you can specify arguments to the build or run commands using the --build-args or --run-args flags followed by a string of arguments.
# For run spec automatically when file changes
KEMAL_ENV=test sentry -r 'crystal' --run-args='spec' --no-buildYou can run multiple sentry process on same project by open a new terminal.
# For run tailwindcss generate output.css
sentry -r 'tailwindcss' --run-args='-o output.css' --no-buildNOTICE, When set -r, --run-args manually, with --no-build usually a good
idea to skip (unused) crystal build process.
This is especially usefull when initiating Sentry from a Dockerfile or package.json file. It guarantees all the shards are installed before running.
./sentry --installSentry will automatically read configurations from .sentry.yml if it exists. This can be changed with -c FILE or --config=FILE.
See definition in .sentry.example.yml for valid file properties.
Sentry output is colorized by default. To remove colorization, pass the --no-color argument.
Example
./sentry --no-colorSee CRYSTAL_API.md
(1) It is tiring to have to stop and restart an app on every change.
(2) Docker!
Stop and restarting your app is especially expensive (and annoying) when running the app in a docker container, where one would need to totally rebuild the docker image for every change.
Now, for development, simply run sentry in your docker container, and it will rebuild the app from the docker container on any changes, without rebuilding the docker image/container.
- Fork it ( https://github.com/samueleaton/sentry/fork )
- Create your feature branch (git checkout -b feat-my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin feat-my-new-feature)
- Create a new Pull Request
- samueleaton Sam Eaton - creator, maintainer
- billy Billy.Zheng - maintainer
Sentry is intended for use in a development environment, where failure is safe and expected 😉.
