Skip to content

Commit

Permalink
Merge pull request #2 from josegonzalez/master
Browse files Browse the repository at this point in the history
Release 0.0.2
  • Loading branch information
josegonzalez authored Jul 28, 2018
2 parents b0a618c + daece3a commit 86237e2
Showing 1 changed file with 37 additions and 30 deletions.
67 changes: 37 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
NAME = procfile-util
EMAIL = [email protected]
MAINTAINER = josegonzalez
MAINTAINER_NAME = Jose Diaz-Gonzalez
REPOSITORY = go-procfile-util
HARDWARE = $(shell uname -m)
VERSION ?= 0.0.2
Expand All @@ -14,6 +16,8 @@ endef
build:
@$(MAKE) build/darwin/$(NAME)
@$(MAKE) build/linux/$(NAME)
@$(MAKE) build/deb/$(NAME)_$(VERSION)_amd64.deb
@$(MAKE) build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm
@$(MAKE) docker-image

build/darwin/$(NAME):
Expand All @@ -22,55 +26,58 @@ build/darwin/$(NAME):
build/linux/$(NAME):
mkdir -p build/linux && CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-X main.Version=$(VERSION)" -o build/linux/$(NAME)

clean:
rm -rf build

circleci:
docker version
rm -f ~/.gitconfig

deps:
go get -u github.com/progrium/gh-release/...
dep ensure -vendor-only

docker-image:
docker build -q -f Dockerfile.build -t $(IMAGE_NAME):$(BUILD_TAG) .

release: build
rm -rf release && mkdir release
tar -zcf release/$(NAME)_$(VERSION)_linux_$(HARDWARE).tgz -C build/linux $(NAME)
tar -zcf release/$(NAME)_$(VERSION)_darwin_$(HARDWARE).tgz -C build/darwin $(NAME)
@$(MAKE) release/$(NAME)_$(VERSION)_amd64.deb
@$(MAKE) release/$(NAME)-$(VERSION)-1.x86_64.rpm
gh-release create $(MAINTAINER)/$(REPOSITORY) $(VERSION) $(shell git rev-parse --abbrev-ref HEAD)

release/$(NAME)_$(VERSION)_amd64.deb: build/linux/$(NAME)
fpm \
build/deb/$(NAME)_$(VERSION)_amd64.deb: build/linux/$(NAME)
mkdir -p build/deb && fpm \
--architecture amd64 \
--category utils \
--description "$$DESCRIPTION" \
--input-type dir \
--license 'MIT License' \
--maintainer "Jose Diaz-Gonzalez <[email protected]>" \
--maintainer "$(MAINTAINER_NAME) <$(EMAIL)>" \
--name procfile-util \
--output-type deb \
--package release/$(NAME)_$(VERSION)_amd64.deb \
--package build/deb/$(NAME)_$(VERSION)_amd64.deb \
--url "https://github.com/$(MAINTAINER)/$(REPOSITORY)" \
--version $(VERSION) \
build/linux/$(NAME)=/usr/local/bin/$(NAME)

release/$(NAME)-$(VERSION)-1.x86_64.rpm: build/linux/$(NAME)
fpm \
build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm: build/linux/$(NAME)
sudo apt install rpm -y
mkdir -p build/rpm && fpm \
--architecture x86_64 \
--category utils \
--description "$$DESCRIPTION" \
--input-type dir \
--license 'MIT License' \
--maintainer "Jose Diaz-Gonzalez <[email protected]>" \
--maintainer "$(MAINTAINER_NAME) <$(EMAIL)>" \
--name procfile-util \
--output-type rpm \
--package release/$(NAME)-$(VERSION)-1.x86_64.rpm \
--package build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm \
--rpm-os linux \
--url "https://github.com/$(MAINTAINER)/$(REPOSITORY)" \
--version $(VERSION) \
build/linux/$(NAME)=/usr/local/bin/$(NAME)

clean:
rm -rf build

circleci:
docker version
rm -f ~/.gitconfig
sudo apt install ruby ruby-dev rubygems build-essential -y
sudo gem install --no-ri --no-rdoc fpm

deps:
go get -u github.com/progrium/gh-release/...
dep ensure -vendor-only

docker-image:
docker build -q -f Dockerfile.build -t $(IMAGE_NAME):$(BUILD_TAG) .

release: build
rm -rf release && mkdir release
tar -zcf release/$(NAME)_$(VERSION)_linux_$(HARDWARE).tgz -C build/linux $(NAME)
tar -zcf release/$(NAME)_$(VERSION)_darwin_$(HARDWARE).tgz -C build/darwin $(NAME)
cp build/deb/$(NAME)_$(VERSION)_amd64.deb release/$(NAME)_$(VERSION)_amd64.deb
cp build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm release/$(NAME)-$(VERSION)-1.x86_64.rpm
gh-release create $(MAINTAINER)/$(REPOSITORY) $(VERSION) $(shell git rev-parse --abbrev-ref HEAD)

0 comments on commit 86237e2

Please sign in to comment.