Skip to content

Commit

Permalink
Merge pull request kubernetes#77 from mikedanese/deb-more
Browse files Browse the repository at this point in the history
various cleanups to debian packages including version bump to v1.4.0-beta3
  • Loading branch information
luxas authored Sep 13, 2016
2 parents 3118efc + bef5757 commit 9689a59
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
8 changes: 4 additions & 4 deletions debian/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package main

import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
"text/template"
"time"
"fmt"
)

type work struct {
Expand Down Expand Up @@ -106,15 +106,15 @@ func (c cfg) run() error {
}
}

err = runCommand(dstdir, "dpkg-buildpackage", "-us", "-uc", "-b", "--host-arch=" + c.DebArch)
err = runCommand(dstdir, "dpkg-buildpackage", "-us", "-uc", "-b", "-a"+c.DebArch)
if err != nil {
return err
}

os.MkdirAll("bin", os.ModeDir)
os.MkdirAll("bin", 0777)

fileName := fmt.Sprintf("%s_%s-%s_%s.deb", c.Package, c.Version, c.Revision, c.DebArch)
err = runCommand("", "mv", "/tmp/" + fileName, "bin/" + fileName)
err = runCommand("", "mv", "/tmp/"+fileName, "bin/"+fileName)
if err != nil {
return err
}
Expand Down
34 changes: 18 additions & 16 deletions debian/build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/bin/bash

ARCHITECTURES="amd64 arm arm64"
DISTROS="xenial"
K8S_VERSIONS="1.3.6 1.4.0-beta.0"
ARCHITECTURES=("amd64" "arm" "arm64")
DISTROS=("xenial")
K8S_VERSIONS=("1.3.6" "1.4.0-beta.3")

# the cni package is named after the latest cni release (0.3.0) plus the k8s revision (1), plus the six first chars from the commit
# this means the kubelet can demand a specific k8s revision by requiring (>= 0.3.0.1)
CNI_VERSION="0.3.0.1-07a8a2"

CNI_VERSION=("0.3.0.1-07a8a2")

if [[ -z $(dpkg --print-foreign-architectures | grep armhf) ]]; then
sudo dpkg --add-architecture armhf
Expand All @@ -16,35 +15,38 @@ if [[ -z $(dpkg --print-foreign-architectures | grep arm64) ]]; then
sudo dpkg --add-architecture arm64
fi

KUBERNETES_CNI_REVISION="00"
if [[ $# == 0 || ! -z $(echo $@ | grep kubernetes-cni) ]]; then

for arch in ${ARCHITECTURES}; do
for distro in ${DISTROS}; do
for arch in "${ARCHITECTURES[@]}"; do
for distro in "${DISTROS[@]}"; do
echo "cni] arch: ${arch} distro: ${distro}"
go run build.go -arch "${arch}" -distro_name "${distro}" -package kubernetes-cni -version ${CNI_VERSION} -revision 00
go run build.go -arch "${arch}" -distro_name "${distro}" -package kubernetes-cni -version ${CNI_VERSION} -revision "${KUBERNETES_CNI_REVISION}"
done
done
fi

KUBECTL_REVISION="02"
if [[ $# == 0 || ! -z $(echo $@ | grep kubectl) ]]; then

for version in ${K8S_VERSIONS}; do
for arch in ${ARCHITECTURES}; do
for distro in ${DISTROS}; do
for version in "${K8S_VERSIONS[@]}"; do
for arch in "${ARCHITECTURES[@]}"; do
for distro in "${DISTROS[@]}"; do
echo "kubectl] version: ${version} arch: ${arch} distro: ${distro}"
go run build.go -arch "${arch}" -distro_name "${distro}" -package kubectl -version "${version}" -revision 02
go run build.go -arch "${arch}" -distro_name "${distro}" -package kubectl -version "${version}" -revision "${KUBECTL_REVISION}"
done
done
done
fi

KUBELET_REVISION="02"
if [[ $# == 0 || ! -z $(echo $@ | grep kubelet) ]]; then

for version in ${K8S_VERSIONS}; do
for arch in ${ARCHITECTURES}; do
for distro in ${DISTROS}; do
for version in "${K8S_VERSIONS[@]}"; do
for arch in "${ARCHITECTURES[@]}"; do
for distro in "${DISTROS[@]}"; do
echo "kubelet] version: ${version} arch: ${arch} distro: ${distro}"
go run build.go -arch "${arch}" -distro_name "${distro}" -package kubelet -version "${version}" -revision 02
go run build.go -arch "${arch}" -distro_name "${distro}" -package kubelet -version "${version}" -revision "${KUBELET_REVISION}"
done
done
done
Expand Down

0 comments on commit 9689a59

Please sign in to comment.