From 3542cafe88bb4edc4d79fbe8b16fd9275e2f9adf Mon Sep 17 00:00:00 2001 From: Jillian W <46452606+jillianwilson@users.noreply.github.com> Date: Mon, 1 Nov 2021 13:29:45 -0300 Subject: [PATCH] Delete Makefile --- secret-injector/Makefile | 98 ---------------------------------------- 1 file changed, 98 deletions(-) delete mode 100644 secret-injector/Makefile diff --git a/secret-injector/Makefile b/secret-injector/Makefile deleted file mode 100644 index 2958af3..0000000 --- a/secret-injector/Makefile +++ /dev/null @@ -1,98 +0,0 @@ -# Image URL to use all building/pushing image targets; -# Use your own docker registry and image name for dev/test by overridding the -# IMAGE_REPO, IMAGE_NAME and IMAGE_TAG environment variable. -IMAGE_REPO ?= docker.io/morvencao -IMAGE_NAME ?= op-secret-injector - -# Github host to use for checking the source tree; -# Override this variable ue with your own value if you're working on forked repo. -GIT_HOST ?= github.com/morvencao - -PWD := $(shell pwd) -BASE_DIR := $(shell basename $(PWD)) - -# Keep an existing GOPATH, make a private one if it is undefined -GOPATH_DEFAULT := $(PWD)/.go -export GOPATH ?= $(GOPATH_DEFAULT) -TESTARGS_DEFAULT := "-v" -export TESTARGS ?= $(TESTARGS_DEFAULT) -DEST := $(GOPATH)/src/$(GIT_HOST)/$(BASE_DIR) -IMAGE_TAG ?= $(shell date +v%Y%m%d)-$(shell git describe --match=$(git rev-parse --short=8 HEAD) --tags --always --dirty) - - -LOCAL_OS := $(shell uname) -ifeq ($(LOCAL_OS),Linux) - TARGET_OS ?= linux - XARGS_FLAGS="-r" -else ifeq ($(LOCAL_OS),Darwin) - TARGET_OS ?= darwin - XARGS_FLAGS= -else - $(error "This system's OS $(LOCAL_OS) isn't recognized/supported") -endif - -all: fmt lint test build image - -ifeq (,$(wildcard go.mod)) -ifneq ("$(realpath $(DEST))", "$(realpath $(PWD))") - $(error Please run 'make' from $(DEST). Current directory is $(PWD)) -endif -endif - -############################################################ -# format section -############################################################ - -fmt: - @echo "Run go fmt..." - -############################################################ -# lint section -############################################################ - -lint: - @echo "Runing the golangci-lint..." - -############################################################ -# test section -############################################################ - -test: - @echo "Running the tests for $(IMAGE_NAME)..." - @go test $(TESTARGS) ./... - -############################################################ -# build section -############################################################ - -build: - @echo "Building the $(IMAGE_NAME) binary..." - @CGO_ENABLED=0 go build -o build/_output/bin/$(IMAGE_NAME) ./cmd/ - -build-linux: - @echo "Building the $(IMAGE_NAME) binary for Docker (linux)..." - @GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o build/_output/linux/bin/$(IMAGE_NAME) ./cmd/ - -############################################################ -# image section -############################################################ - -image: build-image push-image - -build-image: build-linux - @echo "Building the docker image: $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)..." - @docker build -t $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG) -f build/Dockerfile . - -push-image: build-image - @echo "Pushing the docker image for $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG) and $(IMAGE_REPO)/$(IMAGE_NAME):latest..." - @docker tag $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG) $(IMAGE_REPO)/$(IMAGE_NAME):latest - @docker push $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG) - @docker push $(IMAGE_REPO)/$(IMAGE_NAME):latest - -############################################################ -# clean section -############################################################ -clean: - @rm -rf build/_output - -.PHONY: all fmt lint check test build image clean