Update Makefiles.

This commit is contained in:
Orne Brocaar 2022-04-29 11:13:57 +01:00
parent 1e6aad326c
commit eec9b1891d
14 changed files with 34 additions and 30 deletions

View File

@ -1,4 +1,4 @@
.PHONY: dist .PHONY: dist api
# Builds a debug / development binary. # Builds a debug / development binary.
build-debug: build-debug:
@ -13,6 +13,21 @@ dist:
docker-compose run --rm chirpstack-build-amd64 make dist docker-compose run --rm chirpstack-build-amd64 make dist
docker-compose run --rm chirpstack-build-arm64 make dist docker-compose run --rm chirpstack-build-arm64 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. # Builds the UI.
build-ui: build-ui:
docker-compose run --rm chirpstack-ui make build docker-compose run --rm chirpstack-ui make build

8
api/Makefile vendored
View File

@ -1,4 +1,4 @@
.PHONY: rust grpc-web go .PHONY: rust grpc-web go js python
all: all:
docker-compose up docker-compose up
@ -11,3 +11,9 @@ grpc-web:
go: go:
docker-compose run --rm chirpstack-api-go docker-compose run --rm chirpstack-api-go
js:
docker-compose run --rm chirpstack-api-js
python:
docker-compose run --rm chirpstack-api-python

View File

@ -1,8 +1,6 @@
version: "2" version: "2"
services: services:
chirpstack-api-rust: chirpstack-api-rust:
environment:
- VERSION=4.0.0
build: build:
context: . context: .
dockerfile: Dockerfile-rust dockerfile: Dockerfile-rust
@ -17,8 +15,6 @@ services:
volumes: volumes:
- ./:/chirpstack/api - ./:/chirpstack/api
chirpstack-api-grpc-web: chirpstack-api-grpc-web:
environment:
- VERSION=4.0.0
build: build:
context: . context: .
dockerfile: Dockerfile-grpc-web dockerfile: Dockerfile-grpc-web
@ -26,8 +22,6 @@ services:
volumes: volumes:
- ./:/chirpstack/api - ./:/chirpstack/api
chirpstack-api-js: chirpstack-api-js:
environment:
- VERSION=4.0.0
build: build:
context: . context: .
dockerfile: Dockerfile-js dockerfile: Dockerfile-js
@ -35,8 +29,6 @@ services:
volumes: volumes:
- ./:/chirpstack/api - ./:/chirpstack/api
chirpstack-api-python: chirpstack-api-python:
environment:
- VERSION=4.0.0
build: build:
context: . context: .
dockerfile: Dockerfile-python dockerfile: Dockerfile-python

View File

@ -1,6 +1,6 @@
{ {
"name": "@chirpstack/chirpstack-api-grpc-web", "name": "@chirpstack/chirpstack-api-grpc-web",
"version": "4.0.0", "version": "4.0.0-test.1",
"description": "Chirpstack gRPC-web API", "description": "Chirpstack gRPC-web API",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {

5
api/js/Makefile vendored
View File

@ -6,14 +6,11 @@ PROTOC_GEN_GRPC_PATH := ./node_modules/.bin/grpc_tools_node_protoc_plugin
PROTOC_ARGS := -I=/googleapis -I=../proto --plugin=protoc-gen-ts=$(PROTOC_GEN_TS_PATH) --plugin=protoc-gen-grpc=$(PROTOC_GEN_GRPC_PATH) --js_out=import_style=commonjs,binary:. --ts_out=service=grpc-node,mode=grpc-js:. PROTOC_ARGS := -I=/googleapis -I=../proto --plugin=protoc-gen-ts=$(PROTOC_GEN_TS_PATH) --plugin=protoc-gen-grpc=$(PROTOC_GEN_GRPC_PATH) --js_out=import_style=commonjs,binary:. --ts_out=service=grpc-node,mode=grpc-js:.
PROTOC_GRPC_ARGS := $(PROTOC_ARGS) --grpc_out=grpc_js:. PROTOC_GRPC_ARGS := $(PROTOC_ARGS) --grpc_out=grpc_js:.
all: requirements version common gw api integration meta google-api all: requirements common gw api integration meta google-api
requirements: requirements:
yarn install yarn install
version:
sed -i 's/"version.*/"version": "$(VERSION)",/g' ./package.json
common: common:
protoc $(PROTOC_ARGS) ../proto/common/common.proto protoc $(PROTOC_ARGS) ../proto/common/common.proto

2
api/js/package.json vendored
View File

@ -1,6 +1,6 @@
{ {
"name": "@chirpstack/chirpstack-api", "name": "@chirpstack/chirpstack-api",
"version": "4.0.0", "version": "4.0.0-test.1",
"description": "Chirpstack JS and TS API", "description": "Chirpstack JS and TS API",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {

5
api/python/Makefile vendored
View File

@ -4,14 +4,11 @@ PROTOC := python -m grpc_tools.protoc
PROTOC_ARGS := -I=/googleapis -I=proto --python_out=src --grpc_python_out=src PROTOC_ARGS := -I=/googleapis -I=proto --python_out=src --grpc_python_out=src
PACKAGE_NAME := import \"chirpstack-api/ PACKAGE_NAME := import \"chirpstack-api/
all: requirements pre-build version common gw api integration meta all: requirements pre-build common gw api integration meta
requirements: requirements:
pip install grpcio-tools pip install grpcio-tools
version:
sed -i 's/version.*/version = "$(VERSION)",/g' ./src/setup.py
# See: https://github.com/protocolbuffers/protobuf/issues/7061 # See: https://github.com/protocolbuffers/protobuf/issues/7061
pre-build: pre-build:
rm -rf proto rm -rf proto

View File

@ -18,7 +18,7 @@ CLASSIFIERS = [
setup( setup(
name='chirpstack-api', name='chirpstack-api',
version = "4.0.0", version = "4.0.0-test.1",
url='https://github.com/brocaar/chirpstack-api', url='https://github.com/brocaar/chirpstack-api',
author='Orne Brocaar', author='Orne Brocaar',
author_email='info@brocaar.com', author_email='info@brocaar.com',

2
api/rust/Cargo.lock generated vendored
View File

@ -121,7 +121,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "chirpstack_api" name = "chirpstack_api"
version = "4.0.0" version = "4.0.0-test.1"
dependencies = [ dependencies = [
"hex", "hex",
"pbjson", "pbjson",

2
api/rust/Cargo.toml vendored
View File

@ -1,7 +1,7 @@
[package] [package]
name = "chirpstack_api" name = "chirpstack_api"
description = "ChirpStack Protobuf / gRPC API definitions." description = "ChirpStack Protobuf / gRPC API definitions."
version = "4.0.0" version = "4.0.0-test.1"
authors = ["Orne Brocaar <info@brocaar.com>"] authors = ["Orne Brocaar <info@brocaar.com>"]
license = "MIT" license = "MIT"
homepage = "https://www.chirpstack.io" homepage = "https://www.chirpstack.io"

5
api/rust/Makefile vendored
View File

@ -1,6 +1,6 @@
.PHONY: proto version test .PHONY: proto version test
all: proto version test all: proto test
proto: proto:
rm -rf proto rm -rf proto
@ -10,9 +10,6 @@ proto:
cp /googleapis/google/api/annotations.proto proto/google/google/api cp /googleapis/google/api/annotations.proto proto/google/google/api
cp /googleapis/google/api/http.proto proto/google/google/api cp /googleapis/google/api/http.proto proto/google/google/api
version:
sed -i 's/^version.*/version = "$(VERSION)"/g' ./Cargo.toml
test: test:
cargo test cargo test

View File

@ -1,6 +1,6 @@
[package] [package]
name = "backend" name = "backend"
version = "1.0.0" version = "4.0.0-test.1"
authors = ["Orne Brocaar <info@brocaar.com>"] authors = ["Orne Brocaar <info@brocaar.com>"]
edition = "2018" edition = "2018"
publish = false publish = false

View File

@ -3,7 +3,7 @@ name = "lrwn"
description = "Library for encoding / decoding LoRaWAN frames." description = "Library for encoding / decoding LoRaWAN frames."
homepage = "https://www.chirpstack.io" homepage = "https://www.chirpstack.io"
license = "MIT" license = "MIT"
version = "1.0.0" version = "4.0.0-test.1"
authors = ["Orne Brocaar <info@brocaar.com>"] authors = ["Orne Brocaar <info@brocaar.com>"]
edition = "2018" edition = "2018"
repository = "https://github.com/chirpstack/chirpstack" repository = "https://github.com/chirpstack/chirpstack"

View File

@ -1,6 +1,6 @@
{ {
"name": "chirpstack-ui", "name": "chirpstack-ui",
"version": "0.1.0", "version": "4.0.0-test.1",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@ant-design/colors": "^6.0.0", "@ant-design/colors": "^6.0.0",