chirpstack/Makefile
Orne Brocaar 5436582f03 Refactor testing and (cross)compile.
With the update to diesel 2.0.0-rc0, it is now possible to cross-compile
without emulation. Note that during each (cross)compile, we have to
install libpq-dev for the target platform, as only one version can be
installed at a time (e.g. libpq-dev:amd64 conflicts with libpq-dev:armhf).
2022-07-21 11:00:47 +01:00

47 lines
1.4 KiB
Makefile

.PHONY: dist api
# Build distributable binaries.
dist:
docker-compose run --rm --no-deps chirpstack make dist
# Set the versions
version:
test -n "$(VERSION)"
sed -i 's/^version.*/version = "$(VERSION)"/g' ./chirpstack/Cargo.toml
sed -i 's/^version.*/version = "$(VERSION)"/g' ./backend/Cargo.toml
sed -i 's/^version.*/version = "$(VERSION)"/g' ./lrwn/Cargo.toml
sed -i 's/"version.*/"version": "$(VERSION)",/g' ./ui/package.json
sed -i 's/"version.*/"version": "$(VERSION)",/g' ./api/grpc-web/package.json
sed -i 's/"version.*/"version": "$(VERSION)",/g' ./api/js/package.json
sed -i 's/version.*/version = "$(VERSION)",/g' ./api/python/src/setup.py
sed -i 's/^version.*/version = "$(VERSION)"/g' ./api/rust/Cargo.toml
api: version
cd api && make
# Builds the UI.
build-ui:
docker-compose run --rm --no-deps chirpstack-ui make build
# Enters the devshell for ChirpStack development.
devshell:
docker-compose run --rm --service-ports chirpstack bash
# Enters the devshell for ChirpStack UI development.
devshell-ui:
docker-compose run --rm --service-ports chirpstack-ui bash
# Runs the tests
test:
docker-compose run --rm chirpstack make test
docker-compose run --rm chirpstack make test-lrwn
# Starts the ChirpStack server (for testing only).
test-server: build-ui
docker-compose run --rm --service-ports chirpstack make test-server
# Update the Docker development images
update-images:
docker-compose build chirpstack
docker-compose build chirpstack-ui