From 2f425b34965e47dc47eb2447709f33aad110b299 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Fri, 8 May 2020 15:05:36 +0100 Subject: [PATCH] Update makefile --- Makefile | 55 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 48cd5dd..d8ded66 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,61 @@ .DEFAULT_GOAL := default -IMAGE := docker.cloud.cluster.fun/averagemarcus/cors-proxy:latest +IMAGE ?= docker.cluster.fun/averagemarcus/cors-proxy:latest + +.PHONY: test # Run all tests, linting and format checks +test: lint check-format run-tests + +.PHONY: lint # Perform lint checks against code +lint: + @echo "⚠️ 'lint' unimplemented" + +.PHONY: check-format # Checks code formatting and returns a non-zero exit code if formatting errors found +check-format: + @echo "⚠️ 'check-format' unimplemented" + +.PHONY: format # Performs automatic format fixes on all code +format: + @echo "⚠️ 'format' unimplemented" + +.PHONY: run-tests # Runs all tests +run-tests: + @echo "⚠️ 'run-tests' unimplemented" + +.PHONY: fetch-deps # Fetch all project dependencies +fetch-deps: + @npm install + +.PHONY: build # Build the project +build: lint check-format fetch-deps + @echo "⚠️ 'build' unimplemented" .PHONY: docker-build # Build the docker image docker-build: @docker build -t $(IMAGE) . -.PHONY: publish # Publish the docker image to the Artifactory registry -publish: +.PHONY: docker-publish # Push the docker image to the remote registry +docker-publish: @docker push $(IMAGE) +.PHONY: run # Run the application +run: + @npm start + +.PHONY: ci # Perform CI specific tasks to perform on a pull request +ci: + @echo "⚠️ 'ci' unimplemented" + +.PHONY: release # Release the latest version of the application +release: + @kubectl --namespace cors-proxy set image deployment cors-proxy web=docker.cluster.fun/averagemarcus/cors-proxy:$(SHA) + .PHONY: help # Show this list of commands help: - @grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/\1: \2/' | expand -t20 - -default: docker-build publish + @echo "${REPO_NAME}" + @echo "Usage: make [target]" + @echo "" + @echo "target description" | expand -t20 + @echo "-----------------------------------" + @grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/\1 \2/' | expand -t20 +default: test build