diff --git a/debian/build.go b/debian/build.go index c1eb5527490..9afed898eb4 100644 --- a/debian/build.go +++ b/debian/build.go @@ -20,6 +20,8 @@ const ( ChannelStable ChannelType = "stable" ChannelUnstable ChannelType = "unstable" ChannelNightly ChannelType = "nightly" + + cniVersion = "0.5.1" ) type work struct { @@ -60,6 +62,7 @@ var ( architectures = stringList{"amd64", "arm", "arm64", "ppc64le", "s390x"} serverDistros = stringList{"xenial"} allDistros = stringList{"xenial", "jessie", "precise", "sid", "stretch", "trusty", "utopic", "vivid", "wheezy", "wily", "yakkety"} + kubeVersion = "" builtins = map[string]interface{}{ "date": func() string { @@ -74,6 +77,7 @@ func init() { flag.Var(&architectures, "arch", "Architectures to build for.") flag.Var(&serverDistros, "server-distros", "Server distros to build for.") flag.Var(&allDistros, "distros", "Distros to build for.") + flag.StringVar(&kubeVersion, "kube-version", "", "Distros to build for.") } func runCommand(pwd string, command string, cmdArgs ...string) error { @@ -321,17 +325,17 @@ func main() { Distros: serverDistros, Versions: []version{ { - Version: "0.5.1", + Version: cniVersion, Revision: "00", Channel: ChannelStable, }, { - Version: "0.5.1", + Version: cniVersion, Revision: "00", Channel: ChannelUnstable, }, { - Version: "0.5.1", + Version: cniVersion, Revision: "00", Channel: ChannelNightly, }, @@ -363,6 +367,61 @@ func main() { }, } + if kubeVersion != "" { + getSpecifiedVersion := func() (string, error) { + return kubeVersion, nil + } + builds = []build{ + { + Package: "kubectl", + Distros: allDistros, + Versions: []version{ + { + GetVersion: getSpecifiedVersion, + Revision: "00", + Channel: ChannelStable, + GetDownloadLinkBase: getReleaseDownloadLinkBase, + }, + }, + }, + { + Package: "kubelet", + Distros: serverDistros, + Versions: []version{ + { + GetVersion: getSpecifiedVersion, + Revision: "00", + Channel: ChannelStable, + GetDownloadLinkBase: getReleaseDownloadLinkBase, + }, + }, + }, + { + Package: "kubernetes-cni", + Distros: serverDistros, + Versions: []version{ + { + Version: cniVersion, + Revision: "00", + Channel: ChannelStable, + }, + }, + }, + { + Package: "kubeadm", + Distros: serverDistros, + Versions: []version{ + { + GetVersion: getSpecifiedVersion, + Revision: "00", + Channel: ChannelStable, + GetDownloadLinkBase: getReleaseDownloadLinkBase, + }, + }, + }, + } + } + if err := walkBuilds(builds, func(pkg, distro, arch string, v version) error { c := cfg{ Package: pkg, diff --git a/debian/jenkins.sh b/debian/jenkins.sh index 1cbf07404e9..8da3a4c01e1 100755 --- a/debian/jenkins.sh +++ b/debian/jenkins.sh @@ -10,8 +10,8 @@ declare -r BUILD_TAG="$(date '+%y%m%d%H%M%S')" declare -r IMG_NAME="debian-builder:${BUILD_TAG}" declare -r DEB_RELEASE_BUCKET="gs://kubernetes-release-dev/debian" -docker build -t "${IMG_NAME}" debian/ -docker run --rm -v "${PWD}/bin:/src/bin" "${IMG_NAME}" +docker build -t "${IMG_NAME}" "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +docker run --rm -v "${PWD}/bin:/src/bin" "${IMG_NAME}" $@ gsutil -m cp -nrc bin "${DEB_RELEASE_BUCKET}/${BUILD_TAG}" gsutil -m cp <(printf "${BUILD_TAG}") "${DEB_RELEASE_BUCKET}/latest"