Skip to content

Commit

Permalink
Adding BUILD_FOLDER environment
Browse files Browse the repository at this point in the history
  • Loading branch information
tsorya committed Jul 2, 2020
1 parent 62a33ec commit d71e774
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PWD = $(shell pwd)
UID = $(shell id -u)
BUILD_FOLDER = $(PWD)/build

TARGET := $(or ${TARGET},minikube)
KUBECTL=kubectl -n assisted-installer
Expand Down Expand Up @@ -64,13 +65,13 @@ update-expirer: build
create-python-client: build/bm-inventory-client-${GIT_REVISION}.tar.gz

build/bm-inventory-client/setup.py: create-build-dir swagger.yaml
cp swagger.yaml build/
echo '{"packageName" : "bm_inventory_client", "packageVersion": "${GIT_REVISION}"}' > build/code-gen-config.json
sed -i '/pattern:/d' $(PWD)/build/swagger.yaml
docker run -it --rm -u $(shell id -u $(USER)) -v $(PWD)/build:/swagger-api/out \
-v $(PWD)/build/swagger.yaml:/swagger.yaml:ro,Z -v $(PWD)/build/code-gen-config.json:/config.json:ro,Z \
cp swagger.yaml $(BUILD_FOLDER)
echo '{"packageName" : "bm_inventory_client", "packageVersion": "${GIT_REVISION}"}' > $(BUILD_FOLDER)/code-gen-config.json
sed -i '/pattern:/d' $(BUILD_FOLDER)/swagger.yaml
docker run -it --rm -u $(shell id -u $(USER)) -v $(BUILD_FOLDER):/swagger-api/out \
-v $(BUILD_FOLDER)/swagger.yaml:/swagger.yaml:ro,Z -v $(BUILD_FOLDER)/code-gen-config.json:/config.json:ro,Z \
jimschubert/swagger-codegen-cli:2.3.1 generate --lang python --config /config.json --output ./bm-inventory-client/ --input-spec /swagger.yaml
rm -f $(PWD)/build/swagger.yaml
rm -f $(BUILD_FOLDER)/swagger.yaml

build/bm-inventory-client-%.tar.gz: build/bm-inventory-client/setup.py
rm -rf $@
Expand Down

0 comments on commit d71e774

Please sign in to comment.