Skip to content

Building Notifly

  1. Development setup

  2. Build the user interface

    Окно терминала
    $ (cd ui && yarn build)
  3. Build the Go binary

    It is recommended to build Notifly using the notifly/build docker images, this ensures that plugins will be compatible with the built binary (since the same build environment is used).

    Set LD_FLAGS with metadata information such as version or commit:

    Окно терминала
    $ export LD_FLAGS="-w -s -X main.Version=$(git describe --tags | cut -c 2-) -X main.BuildDate=$(date "+%F-%T") -X main.Commit=$(git rev-parse --verify HEAD) -X main.Mode=prod";

    Run the Notifly Makefile tasks to build Notifly.

    Окно терминала
    # builds all supported platforms
    $ make build
    # builds a specific platform
    $ make build-linux-amd64
    $ make build-linux-arm-7
    $ make build-linux-arm64
    $ make build-linux-386
    $ make build-windows-amd64
    $ make build-windows-386

    If you do not want to use the docker images, you can build Notifly like this:

    Окно терминала
    $ go build -ldflags="$LD_FLAGS" -o notifly-server

    The project links CGO (because of sqlite3), so compiling for other platforms requires a CGO cross-compiler (the notifly/build docker images already include the necessary cross-compilers).

    Окно терминала
    $ CGO_ENABLED=1 CC=${CROSS_GCC} CXX=${CROSS_G++} GOOS=${TARGET_GOOS} GOARCH=${TARGET_GOARCH} \
    go build -ldflags="$LD_FLAGS" -o notifly-server