ci: Fix ci when tmp_dir is not set.

When tmp_dir is not set and lib.sh is sourced
could lead to fail.

Fix: #116

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
Jose Carlos Venegas Munoz
2018-07-31 15:21:20 -05:00
parent 6e69deba7f
commit b4a6303b14

View File

@@ -1,6 +1,6 @@
export GOPATH=${GOPATH:-${HOME}/go} export GOPATH=${GOPATH:-${HOME}/go}
readonly kata_arch_sh="${GOPATH}/src/github.com/kata-containers/tests/.ci/kata-arch.sh" readonly kata_arch_sh="${GOPATH}/src/github.com/kata-containers/tests/.ci/kata-arch.sh"
hub_bin="${tmp_dir}/hub-bin" hub_bin="hub-bin"
get_kata_arch(){ get_kata_arch(){
go get -u github.com/kata-containers/tests || true go get -u github.com/kata-containers/tests || true
@@ -69,6 +69,8 @@ build_hub() {
if cmd=$(command -v hub); then if cmd=$(command -v hub); then
hub_bin="${cmd}" hub_bin="${cmd}"
return return
else
hub_bin="${tmp_dir:-/tmp}/hub-bin"
fi fi
local hub_repo="github.com/github/hub" local hub_repo="github.com/github/hub"