Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit bff16e2

Browse files
authored
add hyperkube release scripts (#953)
1 parent 8f601b5 commit bff16e2

File tree

4 files changed

+80
-1
lines changed

4 files changed

+80
-1
lines changed

hack/jenkins/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ This shows an example directory structure, added as part of the `bootkube-e2e-*`
5555

5656
### Currently Defined Jobs
5757

58-
- bootkube-e2e-\*
58+
- tku-bootkube-e2e-\*
5959
- calico: tests a standard single-master bootkube cluster with calico
6060
- flannel: tests a standard single-master bootkube cluster with flannel
61+
- tku-2-release-hyperkube
62+
- default: builds and optionally pushes a hyperkube image to quay.io
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM fedora:27
2+
3+
ENV DOCKER_VERSION "18.03.0-ce"
4+
5+
## Update and install Development tools
6+
RUN dnf -y update && \
7+
dnf -y install which rsync git net-tools wget && \
8+
dnf clean all
9+
10+
## Docker client install
11+
RUN curl -L -o /tmp/docker-$DOCKER_VERSION.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VERSION.tgz && \
12+
tar -xz -C /tmp -f /tmp/docker-$DOCKER_VERSION.tgz && \
13+
mv /tmp/docker/docker /usr/bin && \
14+
rm -rf /tmp/docker-$DOCKER_VERSION /tmp/docker
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// META
2+
repo = "kubernetes-incubator/bootkube"
3+
4+
// CONFIG
5+
org_whitelist = ['coreos', 'coreos-inc']
6+
job_admins = ['colemickens', 'ericchiang', 'rithujohn191', 'rphillips']
7+
user_whitelist = job_admins
8+
9+
// JOBS
10+
job_name = "tku-2-release-hyperkube"
11+
12+
pipelineJob(job_name) {
13+
parameters {
14+
stringParam('BOOTKUBE_VERSION', 'origin/master', 'git reference to build')
15+
stringParam('KUBERNETES_VERSION', 'origin/master', 'git reference to build')
16+
booleanParam('PUSH_IMAGE', false)
17+
}
18+
definition {
19+
cpsScm {
20+
scm {
21+
git {
22+
remote {
23+
github("${repo}")
24+
refspec('+refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/remotes/origin/pr/*')
25+
credentials('github_userpass')
26+
}
27+
branch('${BOOTKUBE_VERSION}')
28+
}
29+
}
30+
scriptPath('hack/jenkins/pipelines/hyperkube-release/Jenkinsfile')
31+
}
32+
}
33+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
podTemplate(label: 'hyperkube-build',
3+
containers: [containerTemplate(name: 'build', image: 'quay.io/coreos/hyperkube-builder:0.2', ttyEnabled: true, command: 'cat')],
4+
volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock')]
5+
) {
6+
node('hyperkube-build') {
7+
stage('stage 1') {
8+
git 'https://github.com/coreos/kubernetes.git'
9+
container('build') {
10+
withCredentials([usernamePassword(credentialsId: 'quay_userpass', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) {
11+
sh '''
12+
export IMAGE_TAG=$(echo ${KUBERNETES_VERSION} | tr + _)
13+
14+
git checkout ${KUBERNETES_VERSION}
15+
build/run.sh make cross ARCH=amd64 KUBE_FASTBUILD=true WHAT=cmd/hyperkube
16+
pushd cluster/images/hyperkube && make VERSION=$(IMAGE_TAG) REGISTRY=quay.io/coreos && popd
17+
docker tag quay.io/coreos/hyperkube-amd64:$IMAGE_TAG quay.io/coreos/hyperkube:$IMAGE_TAG
18+
docker images
19+
if [ "$PUSH_IMAGE" = true ] && ! docker pull quay.io/coreos/hyperkube:$IMAGE_TAG ; then
20+
set +x # don't log passwords
21+
docker login quay.io --username $DOCKER_USER --password $DOCKER_PASS
22+
docker push quay.io/coreos/hyperkube:$IMAGE_TAG
23+
wget https://quay.io/c1/aci/quay.io/coreos/hyperkube/$IMAGE_TAG/aci/linux/amd64/ # warm cache before it gets hit in parallel
24+
fi
25+
'''
26+
}
27+
}
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)