Skip to content

Commit

Permalink
Merge pull request #4556 from afbjorklund/kvm2-packages
Browse files Browse the repository at this point in the history
Add linux packaging for the kvm2 driver binary
  • Loading branch information
afbjorklund authored Jul 16, 2019
2 parents 35753aa + 2ef0f74 commit fccc77c
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 4 deletions.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,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}

0 comments on commit fccc77c

Please sign in to comment.