Title: aah Application Binary Desc: Learn about aah application binary internal, run flags, OS signals, cross compile build and artifact naming convention. Keywords: aah binary, aah app binary, flgas, os signals, cross compile, artifact, artifact naming
Page describe the aah application binary artifact details.
Application binary supports following input flags.
-version
- display the binary name, version and build date.-config
- absolute path of external configuration file, it gets merge into application config before the initialize.-profile
- environment profile name to activate. e.g: dev, qa, prod.
version
flag outputs the binary name, version, and build date. Also build information is available via aah.AppBuildInfo()
method at runtime.
# For e.g.: application binary name is `aahwebsite`
aahwebsite -version
# output
Binary Name : aahwebsite
Version : 381eaa8
Build Date : 2017-04-25T21:00:45-07:00
Supplying external configuration file. It gets merged into application configuration before the initialize.
aahwebsite -config=/etc/aahwebsite/site.conf
Environment profile name to active on startup.
aahwebsite -profile=qa
aah build artifact contains two startup scripts named aah.sh
is for *NIX
and aah.cmd
is for Windows
. However you can create your own startup scripts as per your need with supported input flags.
*NIX
script supports{start|stop|restart|version}
Windows
script supports{start|stop|version}
Note: start
command accepts profile and config arguments.
# For e.g: `aah.sh` *NIX start script with arguments.
./aah.sh start qa
./aah.sh start qa /Users/jeeva/external-config.conf
# To stop
./aah.sh stop
aah application binary listens to SIGINT
and SIGTERM
OS signal. On receiving these signals application performs the graceful shutdown with timeout of config value server.timeout.grace_shutdown
from aah.conf
and then fires the OnShutdown
server event.
Since go1.5
we can build cross platform build easily. aah framework supports it, refer Cross Compile Build
aah build produces the build artifact name as <app-binary-name>-<version>-<goos>-<goarch>.zip
.
For e.g.: aahwebsite-381eaa8-darwin-amd64.zip