Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit ec7287a

Browse files
committed
Support local containerd release.
Signed-off-by: Lantao Liu <[email protected]>
1 parent 40affe7 commit ec7287a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

hack/release.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ INCLUDE_CNI=${INCLUDE_CNI:-false}
3535
CUSTOM_CONTAINERD=${CUSTOM_CONTAINERD:-false}
3636
# OFFICIAL_RELEASE indicates whether to use official containerd release.
3737
OFFICIAL_RELEASE=${OFFICIAL_RELEASE:-false}
38+
# LOCAL_RELEASE indicates that containerd has been built and released
39+
# locally.
40+
LOCAL_RELEASE=${LOCAL_RELEASE:-false}
41+
3842

3943
destdir=${BUILD_DIR}/release-stage
4044

@@ -56,6 +60,16 @@ download_containerd() {
5660
rm -rf "${tmppath}"
5761
}
5862

63+
# copy_local_containerd copies local containerd release.
64+
copy_local_containerd() {
65+
local -r tarball="${GOPATH}/src/github.com/containerd/containerd/releases/containerd-${VERSION}.linux-amd64.tar.gz"
66+
if [[ ! -e "${tarball}" ]]; then
67+
echo "Containerd release is not built"
68+
exit 1
69+
fi
70+
tar -C "${destdir}/usr/local" -xzf "${tarball}"
71+
}
72+
5973
# Install dependencies into release stage.
6074
# Install runc
6175
NOSUDO=true DESTDIR=${destdir} ./hack/install/install-runc.sh
@@ -71,6 +85,8 @@ NOSUDO=true DESTDIR=${destdir} ./hack/install/install-critools.sh
7185
# Install containerd
7286
if $OFFICIAL_RELEASE; then
7387
download_containerd
88+
elif $LOCAL_RELEASE; then
89+
copy_local_containerd
7490
else
7591
# Build containerd from source
7692
NOSUDO=true DESTDIR=${destdir} ./hack/install/install-containerd.sh

0 commit comments

Comments
 (0)