diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e397b64bfc..8010760a933 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,14 +37,7 @@ For contributors who want to work up pull requests, the workflow is roughly: 6. We run a number of linters and tests on each pull request. You may wish to run these locally before submitting your pull request: ```sh - hack/go-fmt.sh . - hack/go-lint.sh $(go list -f '{{ .ImportPath }}' ./...) - hack/go-vet.sh ./... - hack/shellcheck.sh - hack/tf-fmt.sh -list -check - hack/tf-lint.sh - hack/yaml-lint.sh - hack/go-test.sh + make verify ``` 7. Submit a pull request to the original repository. 8. The [repo](OWNERS) [owners](OWNERS_ALIASES) will respond to your issue promptly, following [the ususal Prow workflow][prow-review]. diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..69f088ecf51 --- /dev/null +++ b/Makefile @@ -0,0 +1,53 @@ +# Old-skool build tools. +# +# Targets (see each target for more information): +# all: Build code. +# build: Build code. +# verify: Run build and verify. +# clean: Clean up. + +GO_FILES = $(shell go list -f '{{ .ImportPath }}' ./...) + +# Build code. +# +# Args: +# WHAT: Directory names to build. If any of these directories has a 'main' +# package, the build will produce executable files under $(OUT_DIR)/local/bin. +# If not specified, "everything" will be built. +# GOFLAGS: Extra flags to pass to 'go' when building. +# GOGCFLAGS: Additional go compile flags passed to 'go' when building. +# TESTFLAGS: Extra flags that should only be passed to hack/test-go.sh +# +# Example: +# make +# make all +# make build +all build: + hack/build.sh +.PHONY: all build + +# Verify code conventions are properly setup. +# +# Example: +# make verify +verify: build + { \ + hack/go-fmt.sh . || r=1;\ + hack/go-lint.sh $(GO_FILES) || r=1;\ + hack/go-vet.sh ./... || r=1;\ + hack/shellcheck.sh || r=1;\ + hack/tf-fmt.sh -list -check || r=1;\ + hack/tf-lint.sh || r=1;\ + hack/yaml-lint.sh || r=1;\ + hack/go-test.sh || r=1;\ + exit $$r ;\ + } +.PHONY: verify + +# Remove all build artifacts. +# +# Example: +# make clean +clean: + rm -rf bin/openshift-install +.PHONY: clean diff --git a/README.md b/README.md index a832fa7f9a3..09deb3fa0b9 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ First, install all [build dependencies](docs/dev/dependencies.md). Clone this repository to `src/github.com/openshift/installer` in your [GOPATH](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable). Then build the `openshift-install` binary with: ```sh -hack/build.sh +make ``` This will create `bin/openshift-install`. This binary can then be invoked to create an OpenShift cluster, like so: diff --git a/docs/dev/dependencies.md b/docs/dev/dependencies.md index fcba201cce8..84c555014e1 100644 --- a/docs/dev/dependencies.md +++ b/docs/dev/dependencies.md @@ -7,7 +7,7 @@ The following dependencies must be installed on your system before you can build ### Fedora, CentOS, RHEL ```sh -sudo yum install golang-bin gcc-c++ +sudo yum install golang-bin gcc-c++ podman ``` If you need support for [libvirt destroy](libvirt-howto.md#cleanup), you should also install `libvirt-devel`.