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 linux packaging for the kvm2 driver binary #4556

Merged
merged 2 commits into from
Jul 16, 2019
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
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,23 @@ out/docker-machine-driver-kvm2:
k8s.io/minikube/cmd/drivers/kvm
chmod +X $@

out/docker-machine-driver-kvm2_$(DEB_VERSION).deb: out/docker-machine-driver-kvm2
cp -r installers/linux/deb/kvm2_deb_template out/docker-machine-driver-kvm2_$(DEB_VERSION)
chmod 0755 out/docker-machine-driver-kvm2_$(DEB_VERSION)/DEBIAN
sed -E -i 's/--VERSION--/'$(DEB_VERSION)'/g' out/docker-machine-driver-kvm2_$(DEB_VERSION)/DEBIAN/control
mkdir -p out/docker-machine-driver-kvm2_$(DEB_VERSION)/usr/bin
cp out/docker-machine-driver-kvm2 out/docker-machine-driver-kvm2_$(DEB_VERSION)/usr/bin/docker-machine-driver-kvm2
fakeroot dpkg-deb --build out/docker-machine-driver-kvm2_$(DEB_VERSION)
rm -rf out/docker-machine-driver-kvm2_$(DEB_VERSION)

out/docker-machine-driver-kvm2-$(RPM_VERSION).rpm: out/docker-machine-driver-kvm2
cp -r installers/linux/rpm/kvm2_rpm_template out/docker-machine-driver-kvm2-$(RPM_VERSION)
sed -E -i 's/--VERSION--/'$(RPM_VERSION)'/g' out/docker-machine-driver-kvm2-$(RPM_VERSION)/docker-machine-driver-kvm2.spec
sed -E -i 's|--OUT--|'$(PWD)/out'|g' out/docker-machine-driver-kvm2-$(RPM_VERSION)/docker-machine-driver-kvm2.spec
rpmbuild -bb -D "_rpmdir $(PWD)/out" -D "_rpmfilename docker-machine-driver-kvm2-$(RPM_VERSION).rpm" \
out/docker-machine-driver-kvm2-$(RPM_VERSION)/docker-machine-driver-kvm2.spec
rm -rf out/docker-machine-driver-kvm2-$(RPM_VERSION)

kvm-image: $(KVM_BUILD_IMAGE) # convenient alias to build the docker container
$(KVM_BUILD_IMAGE): installers/linux/kvm/Dockerfile
docker build --build-arg "GO_VERSION=$(GO_VERSION)" -t $@ -f $< $(dir $<)
Expand Down
4 changes: 3 additions & 1 deletion hack/jenkins/release_build_and_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ cat Makefile | grep "VERSION_MINOR ?=" | grep $VERSION_MINOR
cat Makefile | grep "VERSION_BUILD ?=" | grep $VERSION_BUILD

# Build and upload
BUILD_IN_DOCKER=y make -j 16 all out/minikube-installer.exe out/minikube_${DEB_VERSION}.deb out/minikube-${RPM_VERSION}.rpm
BUILD_IN_DOCKER=y make -j 16 all out/minikube-installer.exe \
out/minikube_${DEB_VERSION}.deb out/minikube-${RPM_VERSION}.rpm \
out/docker-machine-driver-kvm2_${DEB_VERSION}.deb out/docker-machine-driver-kvm2-${RPM_VERSION}.rpm
make checksum

gsutil -m cp out/* gs://$BUCKET/releases/$TAGNAME/
Expand Down
12 changes: 12 additions & 0 deletions installers/linux/deb/kvm2_deb_template/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Package: docker-machine-driver-kvm2
Version: --VERSION--
Section: base
Priority: optional
Architecture: amd64
Depends: libvirt0 (>= 1.3.1)
Recommends: minikube
Maintainer: Thomas Strömberg <t+minikube@stromberg.org>
Description: Machine driver for KVM
minikube uses Docker Machine to manage the Kubernetes VM so it benefits
from the driver plugin architecture that Docker Machine uses to provide
a consistent way to manage various VM providers.
6 changes: 3 additions & 3 deletions installers/linux/deb/minikube_deb_template/DEBIAN/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Section: base
Priority: optional
Architecture: amd64
Recommends: virtualbox
Maintainer: Aaron Prindle <aaprindle@gmail.com>
Maintainer: Thomas Strömberg <t+minikube@stromberg.org>
Description: Minikube
Minikube is a tool that makes it easy to run Kubernetes locally.
Minikube runs a single-node Kubernetes cluster inside a VM on your
minikube is a tool that makes it easy to run Kubernetes locally.
minikube runs a single-node Kubernetes cluster inside a VM on your
laptop for users looking to try out Kubernetes or develop with it
day-to-day.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Name: docker-machine-driver-kvm2
Version: --VERSION--
Release: 0
Summary: Machine driver for KVM
License: ASL 2.0
Group: Development/Tools
URL: https://github.com/kubernetes/minikube
#Requires: <determined automatically by rpm>

# Needed for older versions of RPM
BuildRoot: %{_tmppath}%{name}-buildroot

%description
Minikube uses Docker Machine to manage the Kubernetes VM so it benefits
from the driver plugin architecture that Docker Machine uses to provide
a consistent way to manage various VM providers.

%prep
mkdir -p %{name}-%{version}
cd %{name}-%{version}
cp --OUT--/docker-machine-driver-kvm2 .

%install
cd %{name}-%{version}
mkdir -p %{buildroot}%{_bindir}
install -m 755 docker-machine-driver-kvm2 %{buildroot}%{_bindir}/%{name}

%files
%{_bindir}/%{name}