X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=sample-services%2Fics-producer-consumer%2Fproducer%2FMakefile;fp=sample-services%2Fics-producer-consumer%2Fproducer%2FMakefile;h=301526a9a6e84db0bc1ecaa7e1347fb4ea707681;hb=af9b38ae549e2d6a128a00e5d8b9f5f56fc32755;hp=0000000000000000000000000000000000000000;hpb=9ddce2b0e23655371aa311c94ce9605dcc74f74e;p=nonrtric.git diff --git a/sample-services/ics-producer-consumer/producer/Makefile b/sample-services/ics-producer-consumer/producer/Makefile new file mode 100644 index 00000000..301526a9 --- /dev/null +++ b/sample-services/ics-producer-consumer/producer/Makefile @@ -0,0 +1,51 @@ +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# ======================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END================================================= + +# Define variables +IMAGE_NAME = "o-ran-sc/nonrtric-sample-icsproducer" +DOCKERFILE = Dockerfile + +# Default target +.PHONY: all +all: build run + +# Target to build the Maven JAR +.PHONY: jar +jar: + mvn clean package + +# Target to build the Docker image +.PHONY: build +build: + docker build -t $(IMAGE_NAME) -f $(DOCKERFILE) . + +# Target to run the Docker container +.PHONY: run +run: + docker run -p 8080:8080 $(IMAGE_NAME) + +# Target to stop and remove the Docker container +.PHONY: stop +stop: + docker stop $(IMAGE_NAME) || true + docker rm $(IMAGE_NAME) || true + +# Target to clean up +.PHONY: clean +clean: stop + docker rmi $(IMAGE_NAME) || true