diff --git a/scripts/build b/scripts/build index d48a6068b7..96ac81028f 100755 --- a/scripts/build +++ b/scripts/build @@ -1,18 +1,18 @@ #!/bin/bash set -e -x -source $(dirname $0)/version.sh - cd $(dirname $0)/.. + +. ./scripts/version.sh + PKG="github.com/rancher/k3s" PKG_CONTAINERD="github.com/containerd/containerd" PKG_RANCHER_CONTAINERD="github.com/rancher/containerd" PKG_CRICTL="github.com/kubernetes-sigs/cri-tools" -VENDOR_PREFIX= -if [ -z "$(go mod why 2>/dev/null)" ]; then - VENDOR_PREFIX="${PKG}/vendor/" -fi +export GO111MODULE=off + +VENDOR_PREFIX="${PKG}/vendor/" VERSIONFLAGS=" -X ${PKG}/pkg/version.Version=${VERSION} -X ${PKG}/pkg/version.GitCommit=${COMMIT:0:8} diff --git a/scripts/download b/scripts/download index 11070788ed..d1d79607c6 100755 --- a/scripts/download +++ b/scripts/download @@ -1,9 +1,9 @@ #!/bin/bash -source $(dirname $0)/version.sh - cd $(dirname $0)/.. +. ./scripts/version.sh + ROOT_VERSION=v0.3.0 TRAEFIK_VERSION=1.77.1 CHARTS_DIR=build/static/charts diff --git a/scripts/package-airgap b/scripts/package-airgap index adc242fa2e..36dbeb0be1 100755 --- a/scripts/package-airgap +++ b/scripts/package-airgap @@ -1,10 +1,10 @@ #!/bin/bash set -e -x -source $(dirname $0)/version.sh - cd $(dirname $0)/.. +. ./scripts/version.sh + images=$(cat scripts/airgap/image-list.txt) xargs -n1 docker pull <<< "${images}" docker save ${images} -o dist/artifacts/k3s-airgap-images-${ARCH}.tar diff --git a/scripts/package-cli b/scripts/package-cli index ec31409d12..8d473e82e4 100755 --- a/scripts/package-cli +++ b/scripts/package-cli @@ -1,10 +1,10 @@ #!/bin/bash set -e -x -source $(dirname $0)/version.sh - cd $(dirname $0)/.. +. ./scripts/version.sh + rm -rf bin/crictl bin/kubectl bin/k3s-agent bin/k3s-server bin/kubectl bin/k3s build/data ln -s containerd bin/k3s-agent ln -s containerd bin/k3s-server diff --git a/scripts/package-image b/scripts/package-image index 83e803c44a..69f3369ffe 100755 --- a/scripts/package-image +++ b/scripts/package-image @@ -1,10 +1,10 @@ #!/bin/bash set -e -source $(dirname $0)/version.sh - cd $(dirname $0)/.. +. ./scripts/version.sh + TAG=${TAG:-${VERSION}${SUFFIX}} REPO=${REPO:-rancher} IMAGE_NAME=${IMAGE_NAME:-k3s} diff --git a/scripts/sonobuoy-e2e-tests b/scripts/sonobuoy-e2e-tests index d6a4fafc5f..78eece8820 100755 --- a/scripts/sonobuoy-e2e-tests +++ b/scripts/sonobuoy-e2e-tests @@ -4,7 +4,7 @@ set -e -x cd $(dirname $0)/.. if [ -z "$K3S_IMAGE" ]; then - source $(dirname $0)/version.sh + . ./scripts/version.sh TAG=${TAG:-${VERSION}${SUFFIX}} REPO=${REPO:-rancher} IMAGE_NAME=${IMAGE_NAME:-k3s} diff --git a/scripts/version.sh b/scripts/version.sh index f412dc9b1a..6eb101c777 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -16,8 +16,8 @@ fi ARCH=$(go env GOARCH) SUFFIX="-${ARCH}" -VERSION_CONTAINERD=$(grep github.com/containerd/containerd $(dirname $0)/../go.mod | head -n1 | awk '{print $4}') -VERSION_CRICTL=$(grep github.com/kubernetes-sigs/cri-tools $(dirname $0)/../go.mod | head -n1 | awk '{print $4}') +VERSION_CONTAINERD=$(grep github.com/containerd/containerd go.mod | head -n1 | awk '{print $4}') +VERSION_CRICTL=$(grep github.com/kubernetes-sigs/cri-tools go.mod | head -n1 | awk '{print $4}') if [ -z "$VERSION_CONTAINERD" ]; then VERSION_CONTAINERD="v0.0.0"