Enable the cache to speed-up build and lint.
docker volume create squirreldb-ingestor-buildcache
To build binary you may use the build.sh
script. For example to just compile a Go binary:
./build.sh go
Then run SquirrelDB Ingestor:
./squirreldb-ingestor
SquirrelDB Ingestor uses golangci-lint as linter. You may run it with:
./lint.sh
Our release version will be set from the current date.
The release build will
- Compile the Go binary for supported systems
- Build Docker images using Docker buildx
A builder needs to be created to build multi-arch images if it doesn't exist.
docker buildx create --name squirreldb-ingestor-builder
To do a test release, run:
export INGESTOR_VERSION="$(date -u +%y.%m.%d.%H%M%S)"
export INGESTOR_BUILDX_OPTION="--builder squirreldb-ingestor-builder -t squirreldb-ingestor:latest --load"
./build.sh
unset INGESTOR_VERSION INGESTOR_BUILDX_OPTION
The release files are created in the dist/
folder and a Docker image named squirreldb-ingestor:latest
is built.
For production releases, you will want to build the Docker image for multiple architectures, which requires to push the image into a registry. Set image tags ("-t" options) to the wanted destination and ensure you are authorized to push to the destination registry:
export INGESTOR_VERSION="$(date -u +%y.%m.%d.%H%M%S)"
export INGESTOR_BUILDX_OPTION="--builder squirreldb-ingestor-builder --platform linux/amd64,linux/arm64/v8,linux/arm/v7 -t squirreldb-ingestor:latest -t squirreldb-ingestor:${INGESTOR_VERSION} --push"
./build.sh
unset INGESTOR_VERSION INGESTOR_BUILDX_OPTION
On Linux amd64, after building the release you may run it with:
./dist/squirreldb-ingestor_linux_amd64_v1/squirreldb-ingestor