Build and Package
In GoFrame, static resources can also be directly packaged into the executable file. When publishing, you only need to provide one executable file.
- Configuration
hack/config.yaml
gfcli:
build:
name: "hellogf"
arch: "amd64"
system: "linux"
mode: "none"
cgo: 0
packSrc: "manifest/config,resource/public,resource/template"
version: "1.0.0"
output: "./bin"
extra: ""
name
: The name of the packaged executable filearch
: System architecture, can have multiple values separated by commas (,), useall
to compile for all supported architecturessystem
: Compilation platform, can have multiple values separated by commas (,), useall
to compile for all supported systemspackSrc
: Directory of static resources to be packagedversion
: Version number
- Packaging
gf build
The above operation will package the specified directories into the executable file. Typically, files that need to be modified, such as configuration files, do not need to be packaged into the executable file.