-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathclients.sh
More file actions
74 lines (55 loc) · 1.76 KB
/
clients.sh
File metadata and controls
74 lines (55 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
function setup-clients {
local version="${1}"
rerun_log "Installing clients (version ${version})"
rerun_log debug "Resetting PATH to ${ORIGINAL_PATH}"
export PATH="${ORIGINAL_PATH}"
setup-deis-client "${version}"
setup-deisctl-client "${version}"
}
function is-released-version {
[[ ${1} =~ ^([0-9]+\.){0,2}[0-9]$ ]] && return 0
}
function download-client {
local client="${1}"
local version="${2}"
local dir="${3}"
pushd "${dir}"
curl -sSL "http://deis.io/${client}/install.sh" | sh -s "${version}"
popd
}
function setup-deis-client {
# install deis CLI from http://deis.io/ website
local version="${1}"
local client_dir="${TEST_ROOT}/${version}/deis-cli"
mkdir -p "${client_dir}"
if is-released-version "${version}" ; then
rerun_log "Installing deis-cli (${version}) to ${client_dir}..."
download-client "deis-cli" "${version}" "${client_dir}"
export PATH="${client_dir}:${PATH}"
else
rerun_log "Building deis-cli locally..."
git fetch
git checkout "${version}"
make -C client build
export PATH="${DEIS_ROOT}/client/dist:${PATH}"
fi
}
function setup-deisctl-client {
# install deisctl from http://deis.io/ website or from repository
local version="${1}"
unset DEISCTL_UNITS
local client_dir="${TEST_ROOT}/${version}/deisctl"
mkdir -p "${client_dir}"
if is-released-version "${version}" ; then
rerun_log "Installing deisctl (${version}) to ${client_dir}..."
download-client "deisctl" "${version}" "${client_dir}"
export PATH="${client_dir}:${PATH}"
else
rerun_log "Building deisctl locally..."
git fetch
git checkout "${version}"
make -C deisctl build
export DEISCTL_UNITS="${DEIS_ROOT}/deisctl/units"
export PATH="${DEIS_ROOT}/deisctl:${PATH}"
fi
}