-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (22 loc) · 1007 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.PHONY: lint test build docker push deploy all
MAKEFILE_PATH=$(shell readlink -f "${0}")
MAKEFILE_DIR=$(shell dirname "${MAKEFILE_PATH}")
version=$(shell grep 'image: ewohltman/ephemeral-roles-informer:' deployments/kubernetes/deployment.yml | awk -F: '{print $$3}')
parentImage=alpine:latest
lint:
golangci-lint run ./...
test:
go test -v -race -coverprofile=coverage.out ./...
build:
CGO_ENABLED=0 go build -o build/package/ephemeral-roles-informer/ephemeral-roles-informer cmd/ephemeral-roles-informer/ephemeral-roles-informer.go
image:
docker pull "${parentImage}"
docker image build -t ewohltman/ephemeral-roles-informer:${version} build/package/ephemeral-roles-informer
push:
docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}"
docker push ewohltman/ephemeral-roles-informer:${version}
docker tag ewohltman/ephemeral-roles-informer:${version} ewohltman/ephemeral-roles-informer:latest
docker logout
deploy:
${MAKEFILE_DIR}/scripts/deploy.sh
all: lint test build image push deploy