diff --git a/Makefile b/Makefile index bf1501bb5170d029a0c7158116e614e1821749ef..eea00f842ff2a4a663b0c1d87e550382513edc37 100644 --- a/Makefile +++ b/Makefile @@ -10,11 +10,6 @@ REPO_ORG = its-registry.unl.edu/unl-its/docker-ci #################### DOCKERFILES := $(shell find ./ -name "Dockerfile") -# List of images to clean -#################### -#IMAGES_TO_CLEAN := $(shell echo $(shell echo $(shell grep -h LABEL $(DOCKERFILES)) | sed -e 's/LABEL name=//g') | tr [:space:] ' \n' | sort -u) -IMAGES_TO_CLEAN := $(addprefix unl-its/, $(shell find ./ -maxdepth 1 -type d -not -name ".*" -printf '%f\n')) - # Get the latest commit #################### GIT_COMMIT = $(strip $(shell git rev-parse --short HEAD)) @@ -23,7 +18,7 @@ GIT_COMMIT = $(strip $(shell git rev-parse --short HEAD)) #################### BUILD_ARGS := --build-arg VCS_REF=$(GIT_COMMIT) -.PHONY: all clean test $(DOCKERFILES) clean_images $(IMAGES_TO_CLEAN) static-code-analysis mobile delete_dangling_images security publish +.PHONY: all clean test $(DOCKERFILES) static-code-analysis mobile delete_dangling_images security publish all: php-lint php-unit-test magento2 mobile static-code-analysis @@ -50,7 +45,7 @@ php-lint_7.2: php-lint/7.2/Dockerfile docker build $(BUILD_ARGS) -t ${REPO_ORG}/php-lint:7.2 -f php-lint/7.2/Dockerfile php-lint php-lint_latest: php-lint_7.2 - docker tag unl-its/php-lint:7.2 ${REPO_ORG}/php-lint:latest + docker tag ${REPO_ORG}/php-lint:7.2 ${REPO_ORG}/php-lint:latest # PHP Unit Test Images #################### @@ -96,22 +91,13 @@ static-code-analysys_python: static-code-analysis/Dockerfile static-code-analysys_android: android-build-server static-code-analysis/android/Dockerfile docker build $(BUILD_ARGS) -t ${REPO_ORG}/static-code-analysis:android static-code-analysis/android/ -# Cleanup -#################### -clean: clean_images - test: $(DOCKERFILES) $(DOCKERFILES): @echo "Linting and validating $(@D)..." @docker run --rm -i nimmis/label-inspector lint < $(@D)/Dockerfile @docker run --rm -i nimmis/label-inspector validate < $(@D)/Dockerfile -clean_images: $(IMAGES_TO_CLEAN) delete_dangling_images -$(IMAGES_TO_CLEAN): - @echo "Uninstalling $@" - @docker rmi $(shell docker images --format '{{.Repository}}:{{.Tag}}' --filter reference=$@) - -IMAGES_TO_SCAN = $(shell docker images --format '{{.Repository}}:{{.Tag}}' | grep unl-its ) +#IMAGES_TO_SCAN = $(shell docker images --format '{{.Repository}}:{{.Tag}}' | grep unl-its ) #security: # @docker login -u ${TENABLE_IO_ACCESS_KEY} -p ${TENABLE_IO_SECRET_KEY} registry.cloud.tenable.com # @for image in $(IMAGES_TO_SCAN); do \ @@ -132,12 +118,10 @@ delete_dangling_images: help: @echo -e "make [all] \n\t # Creates all the images" @echo -e "make <TARGET> \n\t # Creates an specific image" - @echo -e "make clean \n\t # Cleanup" @echo -e "make publish \n\t # Push the images to the UNL registry" # @echo -e "make security \n\t # Send the images to Tenable. Use env variables TENABLE_IO_ACCESS_KEY and TENABLE_IO_SECRET_KEY" debug: @echo -e "DOCKERFILES: \t $(DOCKERFILES)" - @echo -e "IMAGES_TO_CLEAN:\t $(IMAGES_TO_CLEAN)" - @echo -e "IMAGES_TO_SCAN:\t $(IMAGES_TO_SCAN)" +# @echo -e "IMAGES_TO_SCAN:\t $(IMAGES_TO_SCAN)" @echo -e "IMAGES_TO_PUBLISH:\t $(IMAGES_TO_PUBLISH)"