forked from kubernetes/release
-
Notifications
You must be signed in to change notification settings - Fork 2
/
kirk-release-kubelet.sh
executable file
·62 lines (53 loc) · 1.71 KB
/
kirk-release-kubelet.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}") && pwd)
cd $ROOT
KIRK_REPO_BASIC_AUTH=${KIRK_REPO_BASIC_AUTH:-}
if [ -z "$KIRK_REPO_BASIC_AUTH" ]; then
echo "error: please specify KIRK_REPO_BASIC_AUTH"
exit 1
fi
if [ -z "$KIRK_REPO_UPLOAD_URL" ]; then
echo "error: please specify KIRK_REPO_UPLOAD_URL"
exit 1
fi
function upload_package() {
curl -u "$KIRK_REPO_BASIC_AUTH" -F file=@$1 "$KIRK_REPO_UPLOAD_URL"
}
# build kubelet binary
if [[ -n "${SKIP_BUILD:-}" ]]; then
echo "info: build is skippped"
else
cd $GOPATH/src/k8s.io/kubernetes
./build/run.sh make WHAT='cmd/kubelet'
fi
VERSION=$($GOPATH/src/k8s.io/kubernetes/_output/dockerized/bin/linux/amd64/kubelet --version | cut -d ' ' -f 2)
echo "Kubelet version: $VERSION"
VERSION_DEB=$(echo "$VERSION" | sed 's#^v##')
VERSION_RPM=$(echo "$VERSION" | sed 's#^v##' | sed 's#-#_#')
## build & push deb package
cd $GOPATH/src/k8s.io/release
echo "VERSION: $VERSION"
./debian/run.sh -v $VERSION -r 0
DEB_PKG_PATH=$(find debian/bin/stable/xenial -name "*${VERSION_DEB}*.deb")
if [ ! -f "$DEB_PKG_PATH" ]; then
echo "error: kubelet deb package not found: $DEB_PKG_PATH"
exit 1
fi
echo "Uploading package $DEB_PKG_PATH"
upload_package "$DEB_PKG_PATH"
## build & push rpm package
cd $GOPATH/src/k8s.io/release
cp $GOPATH/src/k8s.io/kubernetes/_output/dockerized/bin/linux/amd64/kubelet rpm/kubelet
cd rpm/
./docker-build.sh amd64/x86_64
cd ../
RPM_PKG_PATH=$(find rpm/output/x86_64/ -name "*${VERSION_RPM}*.rpm")
if [ ! -f "$RPM_PKG_PATH" ]; then
echo "error: kubelet rpm package not found: $RPM_PKG_PATH"
exit 1
fi
echo "Uploading package $RPM_PKG_PATH"
upload_package "$RPM_PKG_PATH"