Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattn/goemon
五右衛門
https://github.com/mattn/goemon
devops go
Last synced: 3 days ago
JSON representation
五右衛門
- Host: GitHub
- URL: https://github.com/mattn/goemon
- Owner: mattn
- Created: 2015-02-23T12:40:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T05:22:07.000Z (over 1 year ago)
- Last Synced: 2024-10-23T01:38:08.707Z (12 days ago)
- Topics: devops, go
- Language: Go
- Homepage:
- Size: 464 KB
- Stars: 182
- Watchers: 11
- Forks: 14
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# goemon
![](https://raw.githubusercontent.com/mattn/goemon/master/data/goemon.png)
**Go** **E**xtensible **Mon**itoring
Speed up your development.
If you updated js files, the page should be reloaded. If you updated go files, the app should be recompiled, and should be restarted. And also, the page should be reloaded## Expected directory structure
```
+---assets
| +- index.html
| +- app.css
| +- app.js
+- main.go
```## Usage
For example:
### Run web server
```
$ goemon -g > goemon.yml
$ goemon go run main.go
```### Writing markdown
```
$ goemon -g md > goemon.yml
$ goemon --
```### Writing C code
```
$ goemon -g c > goemon.yml
$ goemon --
```## Default configuration
```yaml
# Generated by goemon -g
livereload: :35730
tasks:
- match: './assets/*.js'
commands:
- minifyjs -m -i ${GOEMON_TARGET_FILE} > ${GOEMON_TARGET_DIR}/${GOEMON_TARGET_NAME}.min.js
- :livereload /
- match: './assets/*.css'
commands:
- :livereload /
- match: './assets/*.html'
commands:
- :livereload /
- match: '*.go'
commands:
- go build
- :restart
- :livereload /
```* `match` is wildcard. You can use `./foo/bar/**/*.js` like a shell.
* `commands` is list of commands to run. `:XXX` is internal command.| Internal Command | Behavior |
|-------------------|---------------------------------|
| :livereload /path | reload `path` |
| :minify | minify js/css(work in progress) |
| :restart | restart app |
| :sleep 3000 | sleep 3000ms |
| :fizzbuzz 100 | do fizzbuzz(1 to 100) |
| :event :Foo | fire event :Foo |`:event :Foo` fire event defined `- match: :Foo`.
Currently, `:minify` is work in progress. So you should run `minifyjs` command to do it.
For example, configuration in above works as below.| Pattern | Behavior |
|------------------|---------------------------------|
| ./assets/\*.css | reload page |
| ./assets/\*.js | minify js/css, reload page |
| ./assets/\*.html | reload page |
| ./assets/\*.go | build, restart app, reload page |## LiveReload
You can use livereload feature.
```html
Your App
```
## Use goemon as library
```
cat > goemon.go
package mainimport (
_ "github.com/mattn/goemon/auto"
)
^D
```Then `go build`. You don't need to use `goemon` command.
## Installation
```
$ go get github.com/mattn/goemon/cmd/goemon
```
If you want to minify js, install minifyjs like below.```
$ npm install -g minifyjs
```## License
MIT
## Author
Yasuhiro Matsumoto (a.k.a mattn)