From eec9b1891d47be4649680cd0a74ede36062d6415 Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Fri, 29 Apr 2022 11:13:57 +0100 Subject: [PATCH] Update Makefiles. --- Makefile | 17 ++++++++++++++++- api/Makefile | 8 +++++++- api/docker-compose.yml | 8 -------- api/grpc-web/package.json | 2 +- api/js/Makefile | 5 +---- api/js/package.json | 2 +- api/python/Makefile | 5 +---- api/python/src/setup.py | 2 +- api/rust/Cargo.lock | 2 +- api/rust/Cargo.toml | 2 +- api/rust/Makefile | 5 +---- backend/Cargo.toml | 2 +- lrwn/Cargo.toml | 2 +- ui/package.json | 2 +- 14 files changed, 34 insertions(+), 30 deletions(-) diff --git a/Makefile b/Makefile index ce4886f5..358b6687 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: dist +.PHONY: dist api # Builds a debug / development binary. build-debug: @@ -13,6 +13,21 @@ dist: docker-compose run --rm chirpstack-build-amd64 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. build-ui: docker-compose run --rm chirpstack-ui make build diff --git a/api/Makefile b/api/Makefile index 81f3707f..831fd217 100644 --- a/api/Makefile +++ b/api/Makefile @@ -1,4 +1,4 @@ -.PHONY: rust grpc-web go +.PHONY: rust grpc-web go js python all: docker-compose up @@ -11,3 +11,9 @@ grpc-web: go: docker-compose run --rm chirpstack-api-go + +js: + docker-compose run --rm chirpstack-api-js + +python: + docker-compose run --rm chirpstack-api-python diff --git a/api/docker-compose.yml b/api/docker-compose.yml index 3383130c..2639ddec 100644 --- a/api/docker-compose.yml +++ b/api/docker-compose.yml @@ -1,8 +1,6 @@ version: "2" services: chirpstack-api-rust: - environment: - - VERSION=4.0.0 build: context: . dockerfile: Dockerfile-rust @@ -17,8 +15,6 @@ services: volumes: - ./:/chirpstack/api chirpstack-api-grpc-web: - environment: - - VERSION=4.0.0 build: context: . dockerfile: Dockerfile-grpc-web @@ -26,8 +22,6 @@ services: volumes: - ./:/chirpstack/api chirpstack-api-js: - environment: - - VERSION=4.0.0 build: context: . dockerfile: Dockerfile-js @@ -35,8 +29,6 @@ services: volumes: - ./:/chirpstack/api chirpstack-api-python: - environment: - - VERSION=4.0.0 build: context: . dockerfile: Dockerfile-python diff --git a/api/grpc-web/package.json b/api/grpc-web/package.json index 8d9cd2e9..fed32df1 100644 --- a/api/grpc-web/package.json +++ b/api/grpc-web/package.json @@ -1,6 +1,6 @@ { "name": "@chirpstack/chirpstack-api-grpc-web", - "version": "4.0.0", + "version": "4.0.0-test.1", "description": "Chirpstack gRPC-web API", "license": "MIT", "devDependencies": { diff --git a/api/js/Makefile b/api/js/Makefile index 40b24185..8ac93c6b 100644 --- a/api/js/Makefile +++ b/api/js/Makefile @@ -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_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: yarn install -version: - sed -i 's/"version.*/"version": "$(VERSION)",/g' ./package.json - common: protoc $(PROTOC_ARGS) ../proto/common/common.proto diff --git a/api/js/package.json b/api/js/package.json index c3554252..0ce983c1 100644 --- a/api/js/package.json +++ b/api/js/package.json @@ -1,6 +1,6 @@ { "name": "@chirpstack/chirpstack-api", - "version": "4.0.0", + "version": "4.0.0-test.1", "description": "Chirpstack JS and TS API", "license": "MIT", "devDependencies": { diff --git a/api/python/Makefile b/api/python/Makefile index cddf382b..8bfe80ec 100644 --- a/api/python/Makefile +++ b/api/python/Makefile @@ -4,14 +4,11 @@ PROTOC := python -m grpc_tools.protoc PROTOC_ARGS := -I=/googleapis -I=proto --python_out=src --grpc_python_out=src 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: pip install grpcio-tools -version: - sed -i 's/version.*/version = "$(VERSION)",/g' ./src/setup.py - # See: https://github.com/protocolbuffers/protobuf/issues/7061 pre-build: rm -rf proto diff --git a/api/python/src/setup.py b/api/python/src/setup.py index cf6259f3..607316e8 100644 --- a/api/python/src/setup.py +++ b/api/python/src/setup.py @@ -18,7 +18,7 @@ CLASSIFIERS = [ setup( name='chirpstack-api', - version = "4.0.0", + version = "4.0.0-test.1", url='https://github.com/brocaar/chirpstack-api', author='Orne Brocaar', author_email='info@brocaar.com', diff --git a/api/rust/Cargo.lock b/api/rust/Cargo.lock index 7ca17ad7..cfc72e60 100644 --- a/api/rust/Cargo.lock +++ b/api/rust/Cargo.lock @@ -121,7 +121,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chirpstack_api" -version = "4.0.0" +version = "4.0.0-test.1" dependencies = [ "hex", "pbjson", diff --git a/api/rust/Cargo.toml b/api/rust/Cargo.toml index 403b6816..51c61307 100644 --- a/api/rust/Cargo.toml +++ b/api/rust/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "chirpstack_api" description = "ChirpStack Protobuf / gRPC API definitions." -version = "4.0.0" +version = "4.0.0-test.1" authors = ["Orne Brocaar "] license = "MIT" homepage = "https://www.chirpstack.io" diff --git a/api/rust/Makefile b/api/rust/Makefile index 3c4404b6..b3025aaa 100644 --- a/api/rust/Makefile +++ b/api/rust/Makefile @@ -1,6 +1,6 @@ .PHONY: proto version test -all: proto version test +all: proto test proto: rm -rf proto @@ -10,9 +10,6 @@ proto: cp /googleapis/google/api/annotations.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: cargo test diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 4c4d3f50..f989b394 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "backend" -version = "1.0.0" +version = "4.0.0-test.1" authors = ["Orne Brocaar "] edition = "2018" publish = false diff --git a/lrwn/Cargo.toml b/lrwn/Cargo.toml index 8ccc9aa3..bfd5690d 100644 --- a/lrwn/Cargo.toml +++ b/lrwn/Cargo.toml @@ -3,7 +3,7 @@ name = "lrwn" description = "Library for encoding / decoding LoRaWAN frames." homepage = "https://www.chirpstack.io" license = "MIT" -version = "1.0.0" +version = "4.0.0-test.1" authors = ["Orne Brocaar "] edition = "2018" repository = "https://github.com/chirpstack/chirpstack" diff --git a/ui/package.json b/ui/package.json index 4cc2dff5..66c8e306 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "chirpstack-ui", - "version": "0.1.0", + "version": "4.0.0-test.1", "private": true, "dependencies": { "@ant-design/colors": "^6.0.0",