scripts: declare ROOT closer to where it's used, and some DRY changes
This also prevents shellcheck from complaining about a possibly undefined variable. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
dba0ef4eb5
commit
6c257552a7
@ -14,10 +14,14 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
|
basedir="$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
source "${basedir}/utils.sh"
|
||||||
|
|
||||||
|
ROOT="$( cd "${basedir}" && pwd )"/../..
|
||||||
cd "${ROOT}"
|
cd "${ROOT}"
|
||||||
|
|
||||||
# FOCUS focuses the test to run.
|
# FOCUS focuses the test to run.
|
||||||
|
@ -14,8 +14,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/../..
|
|
||||||
|
|
||||||
IS_WINDOWS=0
|
IS_WINDOWS=0
|
||||||
if [ -v "OS" ] && [ "${OS}" == "Windows_NT" ]; then
|
if [ -v "OS" ] && [ "${OS}" == "Windows_NT" ]; then
|
||||||
IS_WINDOWS=1
|
IS_WINDOWS=1
|
||||||
|
@ -27,6 +27,8 @@ set -o pipefail
|
|||||||
basedir="$(dirname "${BASH_SOURCE[0]}")"
|
basedir="$(dirname "${BASH_SOURCE[0]}")"
|
||||||
source "${basedir}/build-utils.sh"
|
source "${basedir}/build-utils.sh"
|
||||||
source "${basedir}/init-buildx.sh"
|
source "${basedir}/init-buildx.sh"
|
||||||
|
|
||||||
|
ROOT="$( cd "$basedir" && pwd )"/..
|
||||||
cd "${ROOT}"
|
cd "${ROOT}"
|
||||||
|
|
||||||
# ignore errors if the image already exists
|
# ignore errors if the image already exists
|
||||||
|
@ -14,10 +14,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/..
|
|
||||||
|
|
||||||
# PROJECT is the gce project to upload tarball.
|
# PROJECT is the gce project to upload tarball.
|
||||||
PROJECT=${PROJECT:-"k8s-cri-containerd"}
|
: "${PROJECT:=k8s-cri-containerd}"
|
||||||
|
|
||||||
# GOOGLE_APPLICATION_CREDENTIALS is the path of service account file.
|
# GOOGLE_APPLICATION_CREDENTIALS is the path of service account file.
|
||||||
if [ -z "${GOOGLE_APPLICATION_CREDENTIALS:-""}" ]; then
|
if [ -z "${GOOGLE_APPLICATION_CREDENTIALS:-""}" ]; then
|
||||||
|
@ -22,7 +22,10 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
source "$(dirname "${BASH_SOURCE[0]}")/build-utils.sh"
|
basedir="$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
source "${basedir}/build-utils.sh"
|
||||||
|
|
||||||
|
ROOT="$( cd "${basedir}" && pwd )"/..
|
||||||
cd "${ROOT}"
|
cd "${ROOT}"
|
||||||
|
|
||||||
# Make sure output directory is clean.
|
# Make sure output directory is clean.
|
||||||
|
Loading…
Reference in New Issue
Block a user