https://github.com/faustinoaq/sentry-run
Use Sentry shard for reload your app
https://github.com/faustinoaq/sentry-run
crystal monitor
Last synced: 11 months ago
JSON representation
Use Sentry shard for reload your app
- Host: GitHub
- URL: https://github.com/faustinoaq/sentry-run
- Owner: faustinoaq
- License: mit
- Created: 2017-03-28T12:47:28.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-21T16:09:01.000Z (almost 8 years ago)
- Last Synced: 2025-04-01T04:32:44.401Z (12 months ago)
- Topics: crystal, monitor
- Language: Crystal
- Size: 92.8 KB
- Stars: 11
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - sentry-run - Reload code changes using Sentry.run (Development Tools)
- awesome-crystal - sentry-run - Reload code changes using Sentry.run (Development Tools)
README

[](https://travis-ci.org/faustinoaq/sentry-run)
A shard using [Sentry](https://github.com/samueleaton/sentry) for reload code changes with `Sentry.run`.
## Installation
Add this to your application's `shard.yml`:
```yaml
development_dependencies:
sentry-run:
github: faustinoaq/sentry-run
```
Then run `shards update`.
## Usage
1. Create a new process with `process = Sentry.config(...)`
2. Execute `Sentry.run(process) do ... end`
```crystal
require "kemal"
require "sentry-run"
get "/" do
"Hello world"
end
process = Sentry.config(
process_name: "App",
build_command: "crystal",
run_command: "./bin/app",
build_args: ["build", "src/app.cr", "-o", "bin/app"],
run_args: ["-p", "9000"])
Sentry.run(process) do
Kemal.run
end
```
You can use `Sentry.run` for recompile and reload your code without external `sentry.cr`.
Default values:
```
process_name : String
build_command : String
run_command : String
build_args = [] of String
run_args = [] of String
files = ["src/**/*.cr", "src/**/*.ecr"]
should_build = true
```
## How does it work?
Basically this shard checks a `sentry.lock` file.
When you run your code `Sentry.run` create a `sentry.lock` and then yield a block. After a code change Sentry recompiles your file and rerun a new app instance with `run_command` in `Sentry.config`.
## Contributing
1. Fork it ( https://github.com/faustinoaq/sentry-run/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Disclaimer
`Sentry.run` is intended for use in a development environment.
## Contributors
- [faustinoaq](https://github.com/faustinoaq) Faustino Aguilar - creator, maintainer