From 77e51e9b03dc0e308ff8349d672c32e7865ccdf2 Mon Sep 17 00:00:00 2001 From: Mohit Sharma Date: Tue, 24 Jan 2023 22:55:12 +0530 Subject: [PATCH 1/2] Adding support to run hcsshim from local clone Signed-off-by: Mohit Sharma --- script/setup/install-runhcs-shim | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/script/setup/install-runhcs-shim b/script/setup/install-runhcs-shim index 892cf31a4..f0b0f0bd2 100755 --- a/script/setup/install-runhcs-shim +++ b/script/setup/install-runhcs-shim @@ -16,6 +16,7 @@ : ${RUNHCS_VERSION:="$(grep 'Microsoft/hcsshim ' go.mod | awk '{print $2}')"} : ${RUNHCS_REPO:="https://github.com/Microsoft/hcsshim.git"} +: ${HCSSHIM_SRC:=''} : ${DESTDIR:=''} : ${GOOS:="windows"} @@ -28,13 +29,15 @@ cleanup() { trap 'cleanup' EXIT export GOOS - -( +if [ "$HCSSHIM_SRC" == "" ] +then set -e -x cd "$tmpdir" git init . git remote add origin "$RUNHCS_REPO" git fetch --tags --depth=1 origin ${RUNHCS_VERSION} - git checkout "refs/tags/${RUNHCS_VERSION}" || git checkout "refs/heads/${RUNHCS_VERSION}" || git checkout "${RUNHCS_VERSION}" - GO111MODULE=on go build -mod=vendor -o "${DESTDIR}/containerd-shim-runhcs-v1.exe" ./cmd/containerd-shim-runhcs-v1 -) \ No newline at end of file +else + cd "${HCSSHIM_SRC}" +fi +git checkout "refs/tags/${RUNHCS_VERSION}" || git checkout "refs/heads/${RUNHCS_VERSION}" || git checkout "${RUNHCS_VERSION}" +GO111MODULE=on go build -mod=vendor -o "${DESTDIR}/containerd-shim-runhcs-v1.exe" ./cmd/containerd-shim-runhcs-v1 \ No newline at end of file From b9b44ed5c537382c092048bc089be227a7627401 Mon Sep 17 00:00:00 2001 From: Mohit Sharma Date: Wed, 1 Feb 2023 20:44:23 +0530 Subject: [PATCH 2/2] Removing end of line for last line Signed-off-by: Mohit Sharma --- script/setup/install-runhcs-shim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/setup/install-runhcs-shim b/script/setup/install-runhcs-shim index f0b0f0bd2..674de52eb 100755 --- a/script/setup/install-runhcs-shim +++ b/script/setup/install-runhcs-shim @@ -40,4 +40,4 @@ else cd "${HCSSHIM_SRC}" fi git checkout "refs/tags/${RUNHCS_VERSION}" || git checkout "refs/heads/${RUNHCS_VERSION}" || git checkout "${RUNHCS_VERSION}" -GO111MODULE=on go build -mod=vendor -o "${DESTDIR}/containerd-shim-runhcs-v1.exe" ./cmd/containerd-shim-runhcs-v1 \ No newline at end of file +GO111MODULE=on go build -mod=vendor -o "${DESTDIR}/containerd-shim-runhcs-v1.exe" ./cmd/containerd-shim-runhcs-v1