All Projects → goccy → rebirth

goccy / rebirth

Licence: MIT License
Supports live reloading for Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to rebirth

zauth
2FA (Two-Factor Authentication) application for CLI terminal with support to import/export andOTP files.
Stars: ✭ 74 (+23.33%)
Mutual labels:  golang-application
authz0
🔑 Authz0 is an automated authorization test tool. Unauthorized access can be identified based on URLs and Roles & Credentials.
Stars: ✭ 248 (+313.33%)
Mutual labels:  golang-application
toggler
toggler is a feature flag service to decouple deployment, feature enrollment and experiments
Stars: ✭ 27 (-55%)
Mutual labels:  golang-application
rss2email
Convert RSS feeds to emails
Stars: ✭ 72 (+20%)
Mutual labels:  golang-application
breakglass
A command line tool to provide login credentials from Hashicorp Vault
Stars: ✭ 33 (-45%)
Mutual labels:  golang-application
jump-jump
开箱即用,Golang 开发的一个功能完善的短链接系统。URL shortener service developed with golang.
Stars: ✭ 110 (+83.33%)
Mutual labels:  golang-application
AutoSpotting
Saves up to 90% of AWS EC2 costs by automating the use of spot instances on existing AutoScaling groups. Installs in minutes using CloudFormation or Terraform. Convenient to deploy at scale using StackSets. Uses tagging to avoid launch configuration changes. Automated spot termination handling. Reliable fallback to on-demand instances.
Stars: ✭ 2,058 (+3330%)
Mutual labels:  golang-application
GOCSP-responder
OCSP responder written in Go meant to be used with easy-rsa
Stars: ✭ 24 (-60%)
Mutual labels:  golang-application
go-mux-jwt-boilerplate
Golang REST API using MUX, GORM, and JWT for authentication
Stars: ✭ 41 (-31.67%)
Mutual labels:  golang-application
jira-cli
🔥 [WIP] Feature-rich interactive Jira command line.
Stars: ✭ 809 (+1248.33%)
Mutual labels:  golang-cli
go-evepraisal
the code that powers evepraisal.com
Stars: ✭ 61 (+1.67%)
Mutual labels:  golang-application
pigger
A cross-platform note taking and static blog writing system in golang
Stars: ✭ 16 (-73.33%)
Mutual labels:  golang-application
smtp-dkim-signer
SMTP-proxy that DKIM-signs e-mails before submission to an upstream SMTP-server.
Stars: ✭ 28 (-53.33%)
Mutual labels:  golang-application
tower
基于反向代理的Golang即时编译工具,可在生产环境下无缝切换到新版本
Stars: ✭ 21 (-65%)
Mutual labels:  live-reload
hotbuild
a cross platform hot compilation tool for golang
Stars: ✭ 181 (+201.67%)
Mutual labels:  live-reload
Morpheus
A Matrix client written in Go-QT
Stars: ✭ 20 (-66.67%)
Mutual labels:  golang-application
gin-rest-api
Example golang using gin framework everything you need, i create this tutorial special for beginner.
Stars: ✭ 56 (-6.67%)
Mutual labels:  golang-application
matrix-corporal
Matrix Corporal: reconciliator and gateway for a managed Matrix server
Stars: ✭ 100 (+66.67%)
Mutual labels:  golang-application
gino-keva
A simple Git Notes Key Value store
Stars: ✭ 23 (-61.67%)
Mutual labels:  golang-application
p5-server
Command-line tool to create and run p5.js sketches. It runs a server with live reload, sketch-aware directory listings, automatic libraries for JavaScript-only sketches.
Stars: ✭ 33 (-45%)
Mutual labels:  live-reload

rebirth Actions Status

Supports live reloading for Go

go_rebirth

Features

  • Better features than github.com/pilu/fresh
  • Supports cross compile and live reloading on host OS for docker users ( Very Fast for Docker for Mac user )
  • Supports cross compile by cgo ( C/C++ ) ( currently, works on macOS ( and target architecture is amd64 ) only )
  • Supports helper commands for go run go test go build

Synopsis

Settings

rebirth needs configuration file ( rebirth.yml ) to running . rebirth init create it .

rebirth.yml example is the following.

task:
  migrate:
    desc: migrate schema
    commands:
      - mysql ....
host:
  docker: container_name
build:
  main: path/to/main.go # change path to main package ( default: . )
  init:
    - echo 'init hook' # called once at starting
  before:
    - echo 'before hook' # called before build
  after:
    - echo 'after hook' # called after build
  env:
    CGO_LDFLAGS: /usr/local/lib/libz.a
run:
  env:
    RUNTIME_ENV: "fuga"
watch:
  root: . # root directory for watching ( default: . )
  ignore:
    - vendor
  • task : define custom command
  • host : specify host information for running to an application ( currently, supports docker only )
  • build : specify ENV variables for building
  • run : specify ENV variables for running
  • watch : specify root directory or ignore directories for watching go file

In case of running on localhost

1. Install rebirth CLI

$ GO111MODULE=on go get -u github.com/goccy/rebirth/cmd/rebirth

2. Create rebirth.yml

$ rebirth init

3. Run rebirth

rebirth

In case of running with Docker for Mac

Example tree

.
├── docker-compose.yml
├── main.go
└── rebirth.yml

main.go is your web application's source.

1. Install rebirth CLI

$ GO111MODULE=on go get -u github.com/goccy/rebirth/cmd/rebirth

2. Install cross compiler for cgo

$ brew install FiloSottile/musl-cross/musl-cross

3. Write settings

docker-compose.yml

version: '2'
services:
  app:
    image: golang:1.13.5
    container_name: rebirth_app
    volumes:
      - '.:/go/src/app'
    working_dir: /go/src/app
    environment:
      GO111MODULE: "on"
    command: |
      tail -f /dev/null

rebirth.yml

host:
  docker: rebirth_app # container_name in docker-compose.yml

4. Run rebirth

$ rebirth

# start live reloading !!

# build for docker container's architecture on macOS (e.g. GOOS=linux GOARCH=amd64
# execute built binary on target container

Helper commands

Usage:
  rebirth [OPTIONS] <command>

Help Options:
  -h, --help  Show this help message

Available commands:
  build  execute 'go build' command
  init   create rebirth.yml for configuration
  run    execute 'go run'   command
  test   execute 'go test'  command

rebirth build

Help cross compile your go script

$ rebirth build -o app script/hoge.go

rebirth test

Help cross compile for go test

$ rebirth test -v ./ -run Hoge

rebirth run

Help cross compile for go run

$ rebirth run script/hoge.go

How it Works

~/work/app directory is mounted on the container as /go/src/app

  1. install rebirth CLI ( GO111MODULE=on go get -u github.com/goccy/rebirth/cmd/rebirth )
  2. run rebirth and it cross compile myself for Linux ( GOOS=linux, GOARCH=amd64 ) and put it to .rebirth directory as __rebirth
  3. copy .rebirth/__rebirth to the container ( .rebirth directory is mounted on the container )
  4. watch main.go ( by fsnotify )

  1. cross compile main.go for Linux and put to .rebirth directory as program
  2. copy .rebirth/program to the container

  1. run __rebirth on the container
  2. __rebirth executes program
  3. edit main.go
  4. rebirth detects file changed event

  1. cross compile main.go for Linux and put to .rebirth directory as program
  2. copy .rebirth/program to the container
  3. rebirth send signal to __rebirth for reloading ( SIGHUP )
  4. __rebirth kill the current application and execute program as a new application

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].