This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INTLY-3357 - add Makefile and organize resources
- Loading branch information
Showing
6 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
ORG=keycloak | ||
NAMESPACE=sso | ||
PROJECT=keycloak-operator | ||
REG=quay.io | ||
SHELL=/bin/bash | ||
TAG?=latest | ||
PKG=github.com/keycloak/keycloak-operator | ||
COMPILE_TARGET=./tmp/_output/bin/$(PROJECT) | ||
|
||
.PHONY: setup/mod | ||
setup/mod: | ||
@echo Adding vendor directory | ||
go mod vendor | ||
@echo setup complete | ||
|
||
.PHONY: setup/travis | ||
setup/travis: | ||
@echo Installing Operator SDK | ||
@curl -Lo operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/v0.10.0/operator-sdk-v0.10.0-x86_64-linux-gnu && chmod +x operator-sdk && sudo mv operator-sdk /usr/local/bin/ | ||
|
||
.PHONY: code/run | ||
code/run: | ||
@operator-sdk up local --namespace=${NAMESPACE} | ||
|
||
.PHONY: code/compile | ||
code/compile: | ||
@GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o=$(COMPILE_TARGET) ./cmd/manager | ||
|
||
.PHONY: code/gen | ||
code/gen: | ||
operator-sdk generate k8s | ||
|
||
.PHONY: code/check | ||
code/check: | ||
@diff -u <(echo -n) <(gofmt -d `find . -type f -name '*.go' -not -path "./vendor/*"`) | ||
|
||
.PHONY: code/fix | ||
code/fix: | ||
@gofmt -w `find . -type f -name '*.go' -not -path "./vendor/*"` | ||
|
||
.PHONY: image/build | ||
image/build: code/compile | ||
@operator-sdk build ${REG}/${ORG}/${PROJECT}:${TAG} | ||
|
||
.PHONY: image/push | ||
image/push: | ||
docker push ${REG}/${ORG}/${PROJECT}:${TAG} | ||
|
||
.PHONY: image/build/push | ||
image/build/push: image/build image/push | ||
|
||
.PHONY: test/unit | ||
test/unit: | ||
@echo Running tests: | ||
go test -v -race -cover ./pkg/... |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.