1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-08-24 02:22:20 +00:00

Add CI/CD and k8s

This commit is contained in:
J. Fernando Sánchez
2018-06-15 09:46:15 +02:00
parent 62142482dc
commit 54da48b548
7 changed files with 118 additions and 15 deletions

View File

@@ -1,30 +1,28 @@
PYVERSION=2.7
NAME=senpycommunity
REPO=gsiupm
VERSION=test
PLUGINS= $(filter %/, $(wildcard */))
DOCKER_FLAGS=
IMAGENAME=gsiupm/senpy-plugins-community
DOCKER_FLAGS=-p 5000:5000
ifdef SENPY_FOLDER
DOCKER_FLAGS+=-v $(realpath $(SENPY_FOLDER)):/usr/src/app/
DOCKER_FLAGS+= -v $(realpath $(SENPY_FOLDER)):/usr/src/app/
endif
all: build run
build: clean Dockerfile
docker build -t '$(REPO)/$(NAME):$(VERSION)-python$(PYVERSION)' -f Dockerfile .;
test-%:
docker run $(DOCKER_FLAGS) -v $$PWD/$*:/senpy-plugins/ --rm -ti '$(REPO)/$(NAME):$(VERSION)-python$(PYVERSION)' --only-test $(TEST_FLAGS)
test: test-.
clean:
clean-docker:
@docker ps -a | awk '/$(REPO)\/$(NAME)/{ split($$2, vers, "-"); if(vers[1] != "${VERSION}"){ print $$1;}}' | xargs docker rm 2>/dev/null|| true
@docker images | awk '/$(REPO)\/$(NAME)/{ split($$2, vers, "-"); if(vers[1] != "${VERSION}"){ print $$1":"$$2;}}' | xargs docker rmi 2>/dev/null|| true
run: build
docker run $(DOCKER_FLAGS) --rm -p 5000:5000 -ti '$(REPO)/$(NAME):$(VERSION)-python$(PYMAIN)'
.PHONY:: test test-% build-% build test test_pip run clean
include .makefiles/base.mk
include .makefiles/k8s.mk
.PHONY: test test-% build-% build test test_pip run clean