Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generation of apiserver-builder executables, .deb and .rpm packages in . #150

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

NAME=apiserver-builder
VENDOR=kubernetes-incubator
VERSION=$(shell cat VERSION)
DESCRIPTION=apiserver-builder implements libraries and tools to quickly and easily build Kubernetes apiservers to support custom resource types.
MAINTAINER=The Kubernetes Authors
URL=https://github.com/$(VENDOR)/$(NAME)
LICENSE=Apache-2.0

.PHONY: default
default: install

.PHONY: test
test:
go test ./pkg/... ./cmd/...
Expand All @@ -20,3 +31,46 @@ test:
install:
go install -v ./pkg/... ./cmd/...

.PHONY: clean
clean:
rm -rf *.deb *.rpm *.tar.gz ./release

.PHONY: build
build: clean ## Create release artefacts for darwin:amd64, linux:amd64 and windows:amd64. Requires etcd, glide, hg.
go run ./cmd/apiserver-builder-release/main.go vendor --version $(VERSION)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preferred format of this command is to pass it a --commit flag to make sure it pulls down the apiserver-builder at the intended versions (and not whatever glide has cached)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain how we could make use of --commit here? Which version would be expected?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR
The most recent commit hash from the apiserver-buidler repo

The release command doesn't use the local src for building the glide.tar.gz with the vendored go code for apiserver-builder++. Instead it uses apiserver-boot (built from the local code) to start a new project, and run glide to download all of the godeps to vendor. The commit here is put in the glide.yaml file to pin the apiserver-builder vendored go libraries. This ensures that the correct version of the libraries are vendored, instead of whatever glide decides it wants to fetch (can depend on the local cache).

go run ./cmd/apiserver-builder-release/main.go build --version $(VERSION)

.PHONY: package
package: package-linux-amd64

.PHONY: package-linux-amd64
package-linux-amd64: package-linux-amd64-deb package-linux-amd64-rpm

.PHONY: package-linux-amd64-deb
package-linux-amd64-deb: ## Create a Debian package. Requires jordansissel/fpm.
fpm --force --name '$(NAME)' --version '$(VERSION)' \
--input-type tar \
--output-type deb \
--vendor '$(VENDOR)' \
--description '$(DESCRIPTION)' \
--url '$(URL)' \
--maintainer '$(MAINTAINER)' \
--license '$(LICENSE)' \
--package $(NAME)-$(VERSION)-amd64.deb \
--prefix /usr/local \
$(NAME)-$(VERSION)-linux-amd64.tar.gz

.PHONY: package-linux-amd64-rpm
package-linux-amd64-rpm: ## Create an RPM package. Requires jordansissel/fpm, rpm.
fpm --force --name '$(NAME)' --version '$(VERSION)' \
--input-type tar \
--output-type rpm \
--vendor '$(VENDOR)' \
--description '$(DESCRIPTION)' \
--url '$(URL)' \
--maintainer '$(MAINTAINER)' \
--license '$(LICENSE)' \
--rpm-os linux \
--package $(NAME)-$(VERSION)-amd64.rpm \
--prefix /usr/local \
$(NAME)-$(VERSION)-linux-amd64.tar.gz
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1-alpha.15