Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
INTLY-3357 - add Makefile and organize resources
Browse files Browse the repository at this point in the history
  • Loading branch information
pb82 authored and slaskawi committed Sep 16, 2019
1 parent 4c68f91 commit 90798a3
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
*.dll
*.so
*.dylib
main
build
tmp

# Test binary, build with `go test -c`
*.test
Expand All @@ -20,4 +23,4 @@ build/_test

# IDE files
.idea
.vscode
.vscode
55 changes: 55 additions & 0 deletions Makefile
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.

0 comments on commit 90798a3

Please sign in to comment.