forked from kubernetes/perf-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubernetes#1906 from tosi3k/golang-new-release
Adjust Golang scripts to the new k8s.io/release commit
- Loading branch information
Showing
1 changed file
with
12 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,6 @@ set -euxo pipefail | |
# Initialize necessary environment variables and git identity. | ||
function init { | ||
export GOROOT=$ROOT_DIR/golang | ||
cd $GOROOT | ||
export TAG=$(date +v%Y%m%d)-$(git rev-parse --short HEAD) | ||
cd .. | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "k8s scalability" | ||
} | ||
|
@@ -35,9 +32,9 @@ function build_kube_cross { | |
|
||
cd $ROOT_DIR/k8s.io/release/images/build/cross | ||
|
||
# Modify Dockerfile to use previously built custom version. | ||
# Modify Dockerfile to use previously built custom version of Go. | ||
# The following assumes that $GOROOT was moved to Dockerfile directory. | ||
sed -i 's#FROM golang.*$#FROM buildpack-deps:stretch-scm\ | ||
sed -i 's#FROM .*$#FROM buildpack-deps:stretch-scm\ | ||
\ | ||
COPY golang /usr/local/go\ | ||
RUN chmod -R a+rx /usr/local/go\ | ||
|
@@ -48,25 +45,29 @@ ENV GOPATH /go\ | |
ENV PATH $GOPATH\/bin:/usr/local/go/bin:$PATH\ | ||
\ | ||
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" \&\& chmod -R 777 "$GOPATH"\ | ||
WORKDIR $GOPATH#' Dockerfile | ||
WORKDIR $GOPATH#' default/Dockerfile | ||
|
||
# Set VERSION contents to the tag of kube-cross Docker image. | ||
sed -i 's#.*#'"$TAG"'#' VERSION | ||
make container REGISTRY=gcr.io/k8s-testimages PLATFORMS=linux/amd64 GO_MAJOR_VERSION=-master OS_CODENAME=debian | ||
|
||
REGISTRY=gcr.io/k8s-testimages | ||
STAGING_REGISTRY=$REGISTRY PROD_REGISTRY=$REGISTRY TAG=$TAG make build | ||
# The make command above changes the docker buildx builder from default | ||
# to a custom one that uses "docker-container" driver (instead of "docker"). | ||
# This driver forces pulling images instead of looking for them in the | ||
# local cache as a primary attempt. As we do not want to use any additional | ||
# container registry, we set the builder back to default. | ||
docker buildx use default | ||
} | ||
|
||
function build_kubernetes { | ||
cd $ROOT_DIR/k8s.io/kubernetes/build/build-image | ||
|
||
# Change the base image of kube-build to our own kube-cross image. | ||
sed -i 's#FROM .*#FROM gcr.io/k8s-testimages/kube-cross-amd64:'"$TAG"'#' Dockerfile | ||
sed -i 's#FROM .*#FROM gcr.io/k8s-testimages/kube-cross-amd64:latest-go-master-debian-default#' Dockerfile | ||
|
||
cd $ROOT_DIR/k8s.io/kubernetes | ||
# Commit changes - needed to not create a "dirty" build, so we can push the | ||
# build to <bucket>/ci directory and update latest.txt file. | ||
git commit -am "Upgrade cross Dockerfile to use kube-cross with newest golang" | ||
|
||
# Build Kubernetes using our kube-cross image. | ||
make quick-release | ||
} | ||
|