Skip to content

Commit 30615c6

Browse files
committed
testing out k8s prow test move
Signed-off-by: Mike Brown <[email protected]>
1 parent d43d546 commit 30615c6

2 files changed

Lines changed: 91 additions & 0 deletions

File tree

test/build-utils.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
# Copyright The containerd Authors.
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/..
18+
19+
# PROJECT is the gce project to upload tarball.
20+
PROJECT=${PROJECT:-"k8s-cri-containerd"}
21+
22+
# GOOGLE_APPLICATION_CREDENTIALS is the path of service account file.
23+
if [ -z ${GOOGLE_APPLICATION_CREDENTIALS} ]; then
24+
echo "GOOGLE_APPLICATION_CREDENTIALS is not set"
25+
exit 1
26+
fi
27+
28+
# Activate gcloud service account.
29+
gcloud auth activate-service-account --key-file "${GOOGLE_APPLICATION_CREDENTIALS}" --project="${PROJECT}"
30+
31+
# Install dependent libraries.
32+
apt-get update
33+
if apt-cache show libbtrfs-dev > /dev/null; then
34+
apt-get install -y libbtrfs-dev
35+
else
36+
apt-get install -y btrfs-tools
37+
fi
38+
39+
# Kubernetes test infra uses jessie and stretch.
40+
if cat /etc/os-release | grep jessie; then
41+
sh -c "echo 'deb http://ftp.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list"
42+
apt-get update
43+
apt-get install -y libseccomp2/jessie-backports
44+
apt-get install -y libseccomp-dev/jessie-backports
45+
else
46+
apt-get install -y libseccomp2
47+
apt-get install -y libseccomp-dev
48+
fi
49+
50+
# PULL_REFS is from prow.
51+
if [ ! -z "${PULL_REFS:-""}" ]; then
52+
DEPLOY_DIR=$(echo "${PULL_REFS}" | sha1sum | awk '{print $1}')
53+
fi

test/build.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# Copyright The containerd Authors.
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# This script is used to build and upload containerd with latest CRI plugin
18+
# from containerd/cri in gcr.io/k8s-testimages/kubekins-e2e.
19+
20+
set -o xtrace
21+
set -o errexit
22+
set -o nounset
23+
set -o pipefail
24+
25+
source $(dirname "${BASH_SOURCE[0]}")/build-utils.sh
26+
cd "${ROOT}"
27+
28+
# Make sure output directory is very clean.
29+
make clean
30+
make build
31+
make binaries
32+
33+
# Build and push test tarball.
34+
# TODO: mikebrow need to build/push a release tar similarly to:
35+
# https://github.com/containerd/containerd/blob/master/.github/workflows/release.yml
36+
# old script:
37+
# PUSH_VERSION=true DEPLOY_DIR=${DEPLOY_DIR:-""} \
38+
# make push TARBALL_PREFIX=cri-containerd-cni INCLUDE_CNI=true CUSTOM_CONTAINERD=true

0 commit comments

Comments
 (0)