open-nomad/scripts/release/Makefile.linux

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

NOMAD_VERSION = 0.9.0-dev
NOMAD_MAIN_VERSION := $(shell echo $(NOMAD_VERSION) | cut -d- -f1)
2019-04-09 01:42:10 +00:00
NOMAD_PRERELEASE_VERSION := $(shell echo $(NOMAD_VERSION) | sed 's|^[^-]*-\{0,1\}||g' )
update_version:
@echo "updating version to $(NOMAD_MAIN_VERSION)-$(NOMAD_PRERELEASE_VERSION)"
@sed -i.bak -e 's|\(Version * = *"\)[^"]*|\1$(NOMAD_MAIN_VERSION)|g' version/version.go
@sed -i.bak -e 's|\(VersionPrerelease * = *"\)[^"]*|\1$(NOMAD_PRERELEASE_VERSION)|g' version/version.go
@rm -rf version/version.go.bak
PRERELEASE_TARGET = prerelease
RELEASE_TARGET = release
build_releases:
@echo "======>> installing dependencies"
$(MAKE) deps
@echo "======>> pre-releasing"
$(MAKE) $(PRERELEASE_TARGET)
@echo "======>> committing generated files"
git add -A .
find . -name '*.generated.go' -not -path './vendor/*' -exec git add -f '{}' \;
2019-03-20 01:18:27 +00:00
# skip comitting files if there are no generated files
# if prerelease process was a no-op
2019-03-16 14:39:24 +00:00
if ! git diff-index --quiet HEAD --; \
then \
git commit --author 'Nomad Release bot <nomad@hashicorp.com>' \
--message "Generate files for $(NOMAD_VERSION) release"; \
fi
@echo "======>> building release artifacts"
$(MAKE) $(RELEASE_TARGET)