-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
28 lines (24 loc) · 973 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
IMAGE_NAME := "syseleven/designate-certmanager-webhook"
IMAGE_TAG ?= $(shell git describe --tags --always --dirty)
build:
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
check:
@if test -n "$$(find . -not \( \( -wholename "./vendor" \) -prune \) -name "*.go" | xargs gofmt -l)"; then \
find . -not \( \( -wholename "./vendor" \) -prune \) -name "*.go" | xargs gofmt -d; \
exit 1; \
fi
test:
docker build --file Dockerfile_test . -t $(IMAGE_NAME)-test
docker run --rm -v $$(pwd):/workspace \
-e TEST_ZONE_NAME=$$TEST_ZONE_NAME \
-e OS_TENANT_NAME=$$OS_TENANT_NAME \
-e OS_TENANT_ID=$$OS_PROJECT_ID \
-e OS_DOMAIN_NAME=$$OS_DOMAIN_NAME \
-e OS_USERNAME=$$OS_USERNAME \
-e OS_PASSWORD=$$OS_PASSWORD \
-e OS_AUTH_URL=$$OS_AUTH_URL \
-e OS_REGION_NAME=$$OS_REGION_NAME \
$(IMAGE_NAME)-test go test -v .
ci-push:
echo "$$DOCKER_PASSWORD" | docker login -u "$$DOCKER_USERNAME" --password-stdin
docker push "$(IMAGE_NAME):$(IMAGE_TAG)"