From 0d336bf7ce4940487bf5f7a8e83b0d804587ce3e Mon Sep 17 00:00:00 2001 From: James Harrington Date: Sat, 12 Sep 2020 15:32:27 -0400 Subject: [PATCH] Move main.go to moactl directory, add make install target --- Makefile | 6 +++++- README.md | 28 ++++++++++++++++++++++++++++ main.go => cmd/moactl/main.go | 0 3 files changed, 33 insertions(+), 1 deletion(-) rename main.go => cmd/moactl/main.go (100%) diff --git a/Makefile b/Makefile index cadf5521e6..17a7505143 100644 --- a/Makefile +++ b/Makefile @@ -26,12 +26,16 @@ unexport GOFLAGS .PHONY: build moactl: generate - go build . + go build ./cmd/moactl .PHONY: test test: go test ./... +.PHONY: install +install: + go install ./cmd/moactl + .PHONY: fmt fmt: gofmt -s -l -w cmd pkg diff --git a/README.md b/README.md index e3c6ac2384..50a1de7fd1 100644 --- a/README.md +++ b/README.md @@ -512,6 +512,34 @@ Once the cluster is uninstalled, you can clean up your CloudFormation stack (thi moactl init --delete-stack ``` +## Build from source + +If you'd like to build this project from source use the following steps: + +1. Checkout the repostiory into your `$GOPATH` + +``` +go get -u github.com/openshift/moactl +``` + +2. `cd` to the checkout out source directory + +``` +cd $GOPATH/src/github.com/openshift/moactl +``` + +3. Install the binary (This will install to `$GOPATH/bin`) + +``` +make install +``` + +NOTE: If you don't have `$GOPATH/bin` in your `$PATH` you need to add it or move `moactl` to a standard system directory eg. for Linux/OSX: + +``` +sudo mv $GOPATH/bin/moactl /usr/local/bin +``` + ## Have you got feedback? We want to hear it. [Open and issue](https://github.com/openshift/moactl/issues/new) against the repo and someone from the team will be in touch. diff --git a/main.go b/cmd/moactl/main.go similarity index 100% rename from main.go rename to cmd/moactl/main.go