docs icon indicating copy to clipboard operation
docs copied to clipboard

Deployment documentation misses important new "buffalo build" options

Open hut8 opened this issue 2 years ago • 0 comments

I deployed my first Buffalo app today. It's a great framework, thanks so much. The deployment documentation seems to have gone out of date. It only lists these options:

Flags:
  -c, --compress         compress static files in the binary (default true)
  -e, --extract-assets   extract the assets and put them in a distinct archive
  -h, --help             help for build
      --ldflags string   set any ldflags to be passed to the go build
  -o, --output string    set the name of the binary (default "bin/coke")
  -s, --static           build a static binary using  --ldflags '-linkmode external -extldflags "-static"' (USE FOR CGO)
  -t, --tags string      compile with specific build tags

Now there are:

Flags:
      --clean-assets               will delete public/assets before calling webpack
      --dry-run                    runs the build 'dry'
      --environment string         set the environment for the binary (default "development")
  -e, --extract-assets             extract the assets and put them in a distinct archive
  -h, --help                       help for build
      --ldflags string             set any ldflags to be passed to the go build
      --mod string                 -mod flag for go build
  -o, --output string              set the name of the binary
  -k, --skip-assets                skip running webpack and building assets
      --skip-build-deps            skip building dependencies
      --skip-template-validation   skip validating templates
  -s, --static                     build a static binary using  --ldflags '-linkmode external -extldflags "-static"'
  -t, --tags string                compile with specific build tags
  -v, --verbose                    print debugging information

The main one I care about is --environment. It seems like buffalo build is going to be used to make an executable for production the vast majority of the time (right?) but the default is development. And the documentation makes no mention of this. If I set this to production, does that mean I don't have to set the environment variable for GO_ENV? What about the webpack configuration?

I will try to answer this myself, but the documentation definitely needs to be improved in this regard.

hut8 avatar Apr 25 '22 23:04 hut8