Skip to content

Commit 2f3f748

Browse files
author
patrik
committed
Rebased from master
1 parent 37ca253 commit 2f3f748

1 file changed

Lines changed: 55 additions & 2 deletions

File tree

linux-installer/idt-installer

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ function help {
2929
--force Force updates of dependencies and other settings during update
3030
--trace Eanble verbose tracing of all activity
3131
32+
33+
3234
If "install" (or no action provided), a full CLI installation (or update) will occur:
3335
1. Pre-req check for 'git', 'docker', 'kubectl', and 'helm'
3436
2. Install latest IBM Cloud 'bx' CLI
@@ -121,6 +123,8 @@ function install_deps {
121123
install_deps_with_apt_get
122124
elif [[ "${DISTRO}" == *Red*Hat* || "${DISTRO}" == *CentOS* || "${DISTRO}" == *RHEL* || "${DISTRO}" == *Fedora* ]]; then
123125
install_deps_with_yum
126+
elif [[ "${DISTRO}" == *Solus* ]]; then
127+
install_deps_with_eopkg
124128
else
125129
error "This script has not been updated for use with your linux distribution (${DISTRO})"
126130
fi
@@ -129,6 +133,55 @@ function install_deps {
129133

130134
}
131135

136+
#------------------------------------------------------------------------------
137+
function install_deps_with_eopkg {
138+
log "Checking for and updating 'eopkg' support on Linux"
139+
if [[ -z "$(which eopkg)" ]]; then
140+
error "'eopkg' is not found. Thats the only linux installer I know, sorry."
141+
fi
142+
$SUDO eopkg ur Solus
143+
144+
#-- CURL:
145+
log "Installing/updating external dependency: curl"
146+
if [[ -z "$(which curl)" || "$FORCE" == true ]]; then
147+
$SUDO eopkg it curl
148+
fi
149+
#-- GIT:
150+
log "Installing/updating external dependency: git"
151+
if [[ -z "$(which git)" || "$FORCE" == true ]]; then
152+
$SUDO eopkg it git
153+
log "Please review any setup requirements for 'git' from: https://git-scm.com/downloads"
154+
fi
155+
156+
#-- Docker:
157+
log "Installing/updating external dependency: docker"
158+
if [[ -z "$(which docker)" || "$FORCE" == true ]]; then
159+
$SUDO eopkg it docker
160+
if [ "$SUDO" ]; then
161+
# Allow docker to run as a non-root user (if not running as root).
162+
sudo groupadd docker 2>/dev/null
163+
sudo usermod -aG docker $USER 2>/dev/null
164+
else
165+
log 'If you want to run docker without sudo run: "sudo groupadd docker && sudo usermod -aG docker $USER"'
166+
fi
167+
log "Please review any setup requirements for 'docker' from: https://docs.docker.com/engine/installation/"
168+
fi
169+
170+
#-- kubectl:
171+
log "Installing/updating external dependency: kubectl"
172+
if [[ -z "$(which kubectl)" || "$FORCE" == true ]]; then
173+
$SUDO eopkg it kubectl
174+
log "Please review any setup requirements for 'kubectl' from: https://kubernetes.io/docs/tasks/tools/install-kubectl/"
175+
fi
176+
177+
#-- helm:
178+
log "Installing/updating external dependency: helm"
179+
if [[ -z "$(which helm)" || "$FORCE" == true ]]; then
180+
curl -fsSL https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
181+
log "Please review any setup requirements for 'helm' from: https://github.com/kubernetes/helm/blob/master/docs/install.md"
182+
fi
183+
}
184+
132185
#------------------------------------------------------------------------------
133186
function install_darwin_deps {
134187
log "Checking for external dependency: brew"
@@ -417,8 +470,8 @@ function main {
417470
"Linux")
418471
# Linux distro, e.g "Ubuntu", "RedHatEnterpriseWorkstation", "RedHatEnterpriseServer", "CentOS", "Debian"
419472
DISTRO=$(lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | head -n1 || uname -om || echo "")
420-
if [[ "$DISTRO" != *Ubuntu* && "$DISTRO" != *Red*Hat* && "$DISTRO" != *CentOS* && "$DISTRO" != *Debian* && "$DISTRO" != *RHEL* && "$DISTRO" != *Fedora* ]]; then
421-
warn "Linux has only been tested on Ubuntu, RedHat, Centos, Debian and Fedora distrubutions please let us know if you use this utility on other Distros"
473+
if [[ "$DISTRO" != *Ubuntu* && "$DISTRO" != *Red*Hat* && "$DISTRO" != *CentOS* && "$DISTRO" != *Debian* && "$DISTRO" != *RHEL* && "$DISTRO" != *Fedora* && "$DISTRO" != *Solus* ]]; then
474+
warn "Linux has only been tested on Ubuntu, RedHat, Centos, Debian, Solus and Fedora distrubutions please let us know if you use this utility on other Distros"
422475
fi
423476
;;
424477
*)

0 commit comments

Comments
 (0)