open-nomad/GNUmakefile

377 lines
11 KiB
Makefile
Raw Normal View History

SHELL = bash
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
PROJECT_ROOT := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
THIS_OS := $(shell uname)
GIT_COMMIT := $(shell git rev-parse HEAD)
GIT_DIRTY := $(if $(shell git status --porcelain),+CHANGES)
2017-11-03 23:01:01 +00:00
GO_LDFLAGS := "-X github.com/hashicorp/nomad/version.GitCommit=$(GIT_COMMIT)$(GIT_DIRTY)"
GO_TAGS ?=
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
GO_TEST_CMD = $(if $(shell which gotestsum),gotestsum --,go test)
ifeq ($(origin GOTEST_PKGS_EXCLUDE), undefined)
GOTEST_PKGS ?= "./..."
else
GOTEST_PKGS=$(shell go list ./... | sed 's/github.com\/hashicorp\/nomad/./' | egrep -v "^($(GOTEST_PKGS_EXCLUDE))(/.*)?$$")
endif
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
default: help
ifeq (,$(findstring $(THIS_OS),Darwin Linux FreeBSD Windows))
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
$(error Building Nomad is currently only supported on Darwin and Linux.)
endif
2019-01-08 01:39:29 +00:00
# On Linux we build for Linux and Windows
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
ifeq (Linux,$(THIS_OS))
2017-08-22 00:09:17 +00:00
2019-05-10 14:14:18 +00:00
ifeq ($(CI),true)
$(info Running in a CI environment, verbose mode is disabled)
else
VERBOSE="true"
endif
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
ALL_TARGETS += linux_386 \
linux_amd64 \
linux_arm \
linux_arm64 \
windows_386 \
windows_amd64
endif
# On MacOS, we only build for MacOS
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
ifeq (Darwin,$(THIS_OS))
ALL_TARGETS += darwin_amd64
endif
# On FreeBSD, we only build for FreeBSD
ifeq (FreeBSD,$(THIS_OS))
ALL_TARGETS += freebsd_amd64
endif
# include per-user customization after all variables are defined
-include GNUMakefile.local
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
pkg/darwin_amd64/nomad: $(SOURCE_FILES) ## Build Nomad for darwin/amd64
2017-09-19 14:47:10 +00:00
@echo "==> Building $@ with tags $(GO_TAGS)..."
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 \
go build \
-ldflags $(GO_LDFLAGS) \
-tags "$(GO_TAGS)" \
-o "$@"
pkg/freebsd_amd64/nomad: $(SOURCE_FILES) ## Build Nomad for freebsd/amd64
@echo "==> Building $@..."
@CGO_ENABLED=1 GOOS=freebsd GOARCH=amd64 \
go build \
-ldflags $(GO_LDFLAGS) \
-tags "$(GO_TAGS)" \
-o "$@"
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
pkg/linux_386/nomad: $(SOURCE_FILES) ## Build Nomad for linux/386
2017-09-19 14:47:10 +00:00
@echo "==> Building $@ with tags $(GO_TAGS)..."
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@CGO_ENABLED=1 GOOS=linux GOARCH=386 \
go build \
-ldflags $(GO_LDFLAGS) \
-tags "$(GO_TAGS)" \
-o "$@"
pkg/linux_amd64/nomad: $(SOURCE_FILES) ## Build Nomad for linux/amd64
2017-09-19 14:47:10 +00:00
@echo "==> Building $@ with tags $(GO_TAGS)..."
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
go build \
-ldflags $(GO_LDFLAGS) \
-tags "$(GO_TAGS)" \
-o "$@"
pkg/linux_arm/nomad: $(SOURCE_FILES) ## Build Nomad for linux/arm
2017-09-19 14:47:10 +00:00
@echo "==> Building $@ with tags $(GO_TAGS)..."
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@CGO_ENABLED=1 GOOS=linux GOARCH=arm CC=arm-linux-gnueabihf-gcc-5 \
go build \
-ldflags $(GO_LDFLAGS) \
-tags "$(GO_TAGS)" \
-o "$@"
pkg/linux_arm64/nomad: $(SOURCE_FILES) ## Build Nomad for linux/arm64
2017-09-19 14:47:10 +00:00
@echo "==> Building $@ with tags $(GO_TAGS)..."
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc-5 \
go build \
-ldflags $(GO_LDFLAGS) \
-tags "$(GO_TAGS)" \
-o "$@"
# If CGO support for Windows is ever required, set the following variables
# in the environment for `go build` for both the windows/amd64 and the
# windows/386 targets:
# CC=i686-w64-mingw32-gcc
# CXX=i686-w64-mingw32-g++
pkg/windows_386/nomad: $(SOURCE_FILES) ## Build Nomad for windows/386
2017-09-19 14:47:10 +00:00
@echo "==> Building $@ with tags $(GO_TAGS)..."
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@CGO_ENABLED=1 GOOS=windows GOARCH=386 \
go build \
-ldflags $(GO_LDFLAGS) \
-tags "$(GO_TAGS)" \
-o "$@.exe"
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
pkg/windows_amd64/nomad: $(SOURCE_FILES) ## Build Nomad for windows/amd64
2017-09-19 14:47:10 +00:00
@echo "==> Building $@ with tags $(GO_TAGS)..."
2017-09-06 00:23:21 +00:00
@CGO_ENABLED=1 GOOS=windows GOARCH=amd64 \
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
go build \
-ldflags $(GO_LDFLAGS) \
-tags "$(GO_TAGS)" \
-o "$@.exe"
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
# Define package targets for each of the build targets we actually have on this system
define makePackageTarget
pkg/$(1).zip: pkg/$(1)/nomad
@echo "==> Packaging for $(1)..."
2017-08-29 05:29:49 +00:00
@zip -j pkg/$(1).zip pkg/$(1)/*
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
endef
# Reify the package targets
$(foreach t,$(ALL_TARGETS),$(eval $(call makePackageTarget,$(t))))
.PHONY: bootstrap
bootstrap: deps lint-deps git-hooks # Install all dependencies
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
.PHONY: deps
2017-10-24 17:49:53 +00:00
deps: ## Install build and development dependencies
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@echo "==> Updating build dependencies..."
go get -u github.com/kardianos/govendor
go get -u github.com/hashicorp/go-bindata/go-bindata
go get -u github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
go get -u github.com/a8m/tree/cmd/tree
go get -u github.com/magiconair/vendorfmt/cmd/vendorfmt
go get -u gotest.tools/gotestsum
@bash -C "$(PROJECT_ROOT)/scripts/install-codecgen.sh"
@bash -C "$(PROJECT_ROOT)/scripts/install-protoc-gen-go.sh"
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
2017-10-24 17:49:53 +00:00
.PHONY: lint-deps
lint-deps: ## Install linter dependencies
@echo "==> Updating linter dependencies..."
go get -u github.com/alecthomas/gometalinter
gometalinter --install
.PHONY: git-hooks
git-dir = $(shell git rev-parse --git-dir)
git-hooks: $(git-dir)/hooks/pre-push
$(git-dir)/hooks/%: dev/hooks/%
cp $^ $@
chmod 755 $@
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
.PHONY: check
check: ## Lint the source code
@echo "==> Linting source code..."
@gometalinter \
--deadline 10m \
--vendor \
2017-09-26 22:26:33 +00:00
--exclude='.*\.generated\.go' \
2019-09-03 14:59:11 +00:00
--exclude='.*\.pb\.go' \
2017-09-26 22:26:33 +00:00
--exclude='.*bindata_assetfs\.go' \
2017-09-19 16:49:34 +00:00
--skip="ui/" \
2017-09-26 22:26:33 +00:00
--sort="path" \
--aggregate \
--enable-gc \
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
--disable-all \
2017-09-26 22:26:33 +00:00
--enable goimports \
--enable misspell \
--enable vet \
--enable deadcode \
--enable varcheck \
--enable ineffassign \
--enable structcheck \
--enable unconvert \
--enable gofmt \
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
./...
2017-09-27 18:14:37 +00:00
@echo "==> Spell checking website..."
@misspell -error -source=text website/source/
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@echo "==> Check proto files are in-sync..."
@$(MAKE) proto
@if (git status | grep -q .pb.go); then echo the following proto files are out of sync; git status |grep .pb.go; exit 1; fi
@echo "==> Check API package is isolated from rest"
@! go list -f '{{ join .Deps "\n" }}' ./api | grep github.com/hashicorp/nomad/ | grep -v -e /vendor/ -e /nomad/api/
.PHONY: checkscripts
checkscripts: ## Lint shell scripts
@echo "==> Linting scripts..."
2019-03-18 12:45:25 +00:00
@find scripts -type f -name '*.sh' | xargs shellcheck
2018-11-07 19:51:03 +00:00
.PHONY: generate-all
generate-all: generate-structs proto generate-examples
2018-11-07 19:51:03 +00:00
.PHONY: generate-structs
generate-structs: LOCAL_PACKAGES = $(shell go list ./... | grep -v '/vendor/')
generate-structs: ## Update generated code
@echo "--> Running go generate..."
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@go generate $(LOCAL_PACKAGES)
.PHONY: proto
proto:
@echo "--> Generating proto bindings..."
@for file in $$(git ls-files "*.proto" | grep -v "vendor\/.*.proto"); do \
protoc -I . -I ../../.. --go_out=plugins=grpc:. $$file; \
done
.PHONY: generate-examples
generate-examples: command/job_init.bindata_assetfs.go
command/job_init.bindata_assetfs.go: command/assets/*
go-bindata-assetfs -pkg command -o command/job_init.bindata_assetfs.go ./command/assets/...
vendorfmt:
@echo "--> Formatting vendor/vendor.json"
test -x $(GOPATH)/bin/vendorfmt || go get -u github.com/magiconair/vendorfmt/cmd/vendorfmt
vendorfmt
2017-12-12 21:52:58 +00:00
changelogfmt:
@echo "--> Making [GH-xxxx] references clickable..."
@sed -E 's|([^\[])\[GH-([0-9]+)\]|\1[[GH-\2](https://github.com/hashicorp/nomad/issues/\2)]|g' CHANGELOG.md > changelog.tmp && mv changelog.tmp CHANGELOG.md
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
.PHONY: dev
dev: GOOS=$(shell go env GOOS)
dev: GOARCH=$(shell go env GOARCH)
dev: GOPATH=$(shell go env GOPATH)
2019-01-08 01:39:29 +00:00
dev: DEV_TARGET=pkg/$(GOOS)_$(GOARCH)/nomad
2018-01-03 22:38:41 +00:00
dev: vendorfmt changelogfmt ## Build for the current development platform
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@echo "==> Removing old development build..."
@rm -f $(PROJECT_ROOT)/$(DEV_TARGET)
@rm -f $(PROJECT_ROOT)/bin/nomad
@rm -f $(GOPATH)/bin/nomad
@$(MAKE) --no-print-directory \
$(DEV_TARGET) \
GO_TAGS="$(GO_TAGS) $(NOMAD_UI_TAG)"
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@mkdir -p $(PROJECT_ROOT)/bin
@mkdir -p $(GOPATH)/bin
@cp $(PROJECT_ROOT)/$(DEV_TARGET) $(PROJECT_ROOT)/bin/
@cp $(PROJECT_ROOT)/$(DEV_TARGET) $(GOPATH)/bin
2017-10-26 17:08:19 +00:00
.PHONY: prerelease
prerelease: GO_TAGS=ui release
prerelease: generate-all ember-dist static-assets ## Generate all the static assets for a Nomad release
2017-10-26 17:08:19 +00:00
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
.PHONY: release
release: GO_TAGS=ui release
2017-10-26 17:08:19 +00:00
release: clean $(foreach t,$(ALL_TARGETS),pkg/$(t).zip) ## Build all release packages which can be built on this platform.
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@echo "==> Results:"
@tree --dirsfirst $(PROJECT_ROOT)/pkg
.PHONY: test
2017-09-19 14:47:10 +00:00
test: ## Run the Nomad test suite and/or the Nomad UI test suite
@if [ ! $(SKIP_NOMAD_TESTS) ]; then \
make test-nomad; \
fi
@if [ $(RUN_WEBSITE_TESTS) ]; then \
make test-website; \
fi
2017-09-19 14:47:10 +00:00
@if [ $(RUN_UI_TESTS) ]; then \
make test-ui; \
fi
2018-09-19 17:21:57 +00:00
@if [ $(RUN_E2E_TESTS) ]; then \
make e2e-test; \
fi
2017-09-19 14:47:10 +00:00
.PHONY: test-nomad
2017-10-24 16:35:51 +00:00
test-nomad: dev ## Run Nomad test suites
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@echo "==> Running Nomad test suites:"
$(if $(ENABLE_RACE),GORACE="strip_path_prefix=$(GOPATH)/src") $(GO_TEST_CMD) \
$(if $(ENABLE_RACE),-race) $(if $(VERBOSE),-v) \
-cover \
-timeout=15m \
2019-05-10 14:14:18 +00:00
$(GOTEST_PKGS) $(if $(VERBOSE), >test.log ; echo $$? > exit-code)
@if [ $(VERBOSE) ] ; then \
bash -C "$(PROJECT_ROOT)/scripts/test_check.sh" ; \
fi
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
2018-09-19 01:46:33 +00:00
.PHONY: e2e-test
2018-09-19 17:38:20 +00:00
e2e-test: dev ## Run the Nomad e2e test suite
2018-09-19 01:46:33 +00:00
@echo "==> Running Nomad E2E test suites:"
go test \
$(if $(ENABLE_RACE),-race) $(if $(VERBOSE),-v) \
-cover \
-timeout=900s \
2018-11-29 14:37:26 +00:00
github.com/hashicorp/nomad/e2e/vault/ \
-integration
2018-09-19 01:46:33 +00:00
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
.PHONY: clean
clean: GOPATH=$(shell go env GOPATH)
clean: ## Remove build artifacts
@echo "==> Cleaning build artifacts..."
@rm -rf "$(PROJECT_ROOT)/bin/"
@rm -rf "$(PROJECT_ROOT)/pkg/"
@rm -f "$(GOPATH)/bin/nomad"
.PHONY: testcluster
testcluster: ## Bring up a Linux test cluster using Vagrant. Set PROVIDER if necessary.
vagrant up nomad-server01 \
nomad-server02 \
nomad-server03 \
nomad-client01 \
nomad-client02 \
nomad-client03 \
$(if $(PROVIDER),--provider $(PROVIDER))
2017-09-19 14:47:10 +00:00
.PHONY: static-assets
static-assets: ## Compile the static routes to serve alongside the API
@echo "--> Generating static assets"
@go-bindata-assetfs -pkg agent -prefix ui -modtime 1480000000 -tags ui -o bindata_assetfs.go ./ui/dist/...
2017-09-19 14:47:10 +00:00
@mv bindata_assetfs.go command/agent
2018-11-20 02:50:42 +00:00
.PHONY: test-website
test-website: ## Run Website Link Checks
@cd website && make test
2017-09-19 14:47:10 +00:00
.PHONY: test-ui
2017-11-13 19:57:17 +00:00
test-ui: ## Run Nomad UI test suite
2017-09-19 14:47:10 +00:00
@echo "--> Installing JavaScript assets"
2017-12-14 01:04:15 +00:00
@cd ui && npm rebuild node-sass
2017-09-19 14:47:10 +00:00
@cd ui && yarn install
@echo "--> Running ember tests"
@cd ui && npm test
.PHONY: ember-dist
ember-dist: ## Build the static UI assets from source
@echo "--> Installing JavaScript assets"
@cd ui && yarn install --silent
2017-09-19 14:47:10 +00:00
@cd ui && npm rebuild node-sass
@echo "--> Building Ember application"
@cd ui && npm run build
.PHONY: dev-ui
dev-ui: ember-dist static-assets
@$(MAKE) NOMAD_UI_TAG="ui" dev ## Build a dev binary with the UI baked in
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
HELP_FORMAT=" \033[36m%-25s\033[0m %s\n"
.PHONY: help
help: ## Display this usage information
@echo "Valid targets:"
@grep -E '^[^ ]+:.*?## .*$$' $(MAKEFILE_LIST) | \
sort | \
awk 'BEGIN {FS = ":.*?## "}; \
{printf $(HELP_FORMAT), $$1, $$2}'
2017-11-13 19:57:17 +00:00
@echo ""
@echo "This host will build the following targets if 'make release' is invoked:"
build: Replace shell scripts with GNUmakefile This commit replaces the shell script-driven build process for Nomad with one based around GNU Make (note we _do_ use GNU-specific constructs), requiring no additional scripts for common cases of development. The following targets are implemented: Per-OS/arch combinations: Binaries (Host - Mac OS X): pkg/darwin_amd64/nomad Binaries (Host - Linux): pkg/linux_386/nomad pkg/linux_amd64/nomad pkg/linux_amd64-lxc/nomad pkg/linux_arm/nomad pkg/linux_arm64/nomad pkg/windows_386/nomad pkg/windows_amd64/nomad Packages (Host - Mac OS X): pkg/darwin_amd64.zip Packages (Host - Linux): pkg/linux_386.zip pkg/linux_amd64.zip pkg/linux_amd64-lxc.zip pkg/linux_arm.zip pkg/linux_arm64.zip pkg/windows_386.zip pkg/windows_amd64.zip Phony targets: dev - Builds for the current host GOOS/GOARCH (unless overriden in the environment) release - Builds all appropriate release packages for the current host GOOS/GOARCH (i.e. Windows and Linux packages on a Linux host, Darwin packages on an OSX host) generate - Generate code for the current host architecture using `go generate`. test - Runs the Nomad test suite clean - Removes build artifacts travis - Runs `make test` with the wrapper script to prevent Travis CI from timing out. help - Displays usage information about commonly used targets. Note that there are some semantic differences from the previous version. 1. `generate` is no longer a dependency of `dev` builds. This is because it causes a rebuild every time, even when no code has changed, since `go generate` does not appear to leave file timestamps alone. Regardless, it is insufficient to generate on one host OS - it needs to be run on each target to ensure everything is generated correctly. 2. `gofmt` is no longer checked. This should be enabled as a linter once the `gofmt -s` refactoring will pass on the whole code base, in order to avoid special cased checks versus using go-metalinter. Example Usages: Make a development build for the current GOOS/GOARCH: make dev Make release build packages appropriate for the host OS: make release Update generated code for the host OS: make generate Run linting checks: make check Build a specific alternative GOOS/GOARCH/tags combination: make pkg/linux_amd64-pkg/nomad make pkg/linux_amd64-pkg.zip
2017-08-18 05:29:26 +00:00
@echo $(ALL_TARGETS) | sed 's/^/ /'
2019-06-20 00:20:13 +00:00
2019-08-12 16:39:54 +00:00
.PHONY: ui-screenshots
2019-06-20 00:20:13 +00:00
ui-screenshots:
@echo "==> Collecting UI screenshots..."
# Build the screenshots image if it doesn't exist yet
@if [[ "$$(docker images -q nomad-ui-screenshots 2> /dev/null)" == "" ]]; then \
docker build --tag="nomad-ui-screenshots" ./scripts/screenshots; \
fi
@docker run \
--rm \
--volume "$(shell pwd)/scripts/screenshots/screenshots:/screenshots" \
nomad-ui-screenshots
2019-08-12 16:39:54 +00:00
.PHONY: ui-screenshots-local
2019-06-20 00:20:13 +00:00
ui-screenshots-local:
@echo "==> Collecting UI screenshots (local)..."
@cd scripts/screenshots/src && SCREENSHOTS_DIR="../screenshots" node index.js