Skip to content

Commit 94dd0ea

Browse files
authored
Merge pull request #73 from Heshdude/master
Installer script additions and updates
2 parents dbaf9f4 + 8e06959 commit 94dd0ea

18 files changed

+298
-95
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@ Try,
1515
```
1616
curl https://installer.to/git | bash
1717
```
18-
__
18+
1919
This will install Git on your machine!
2020

2121
## Tools list
2222
<!-- beginning of tools list -->
2323
| Tool |Apt|Yum|Packman|APK|DNF|CURL| URL |
2424
|--------|---|---|-------|---|---|----|----------------------------|
25-
|Git |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/git |
26-
|Hello |Yes|Yes|Yes |Yes|Yes|Yes |https://installer.to/hello |
2725
|NodeJS |Yes|Yes|No |Yes|Yes|No |https://installer.to/node |
28-
|Python 3|Yes|Yes|Yes |Yes|Yes|No |https://installer.to/python3|
29-
|Nginx |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/nginx |
26+
|Kubectl |Yes|Yes|No |No |No |Yes |https://installer.to/kubectl|
27+
|Git |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/git |
3028
|gCloud |No |No |No |No |No |Yes |https://installer.to/gcloud |
31-
|Docker |Yes|Yes|No |No |No |No |https://installer.to/docker |
29+
|Nginx |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/nginx |
3230
|Fabric |No |No |No |No |No |Yes |https://installer.to/hlf |
31+
|Docker |Yes|Yes|No |No |No |No |https://installer.to/docker |
32+
|cTop |No |No |No |No |No |Yes |https://installer.to/ctop |
33+
|Hello |Yes|Yes|Yes |Yes|Yes|Yes |https://installer.to/hello |
34+
|Python 3|Yes|Yes|Yes |Yes|Yes|No |https://installer.to/python3|
3335

3436
<!-- end of tools list -->

installers.toml

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,49 @@
1+
[node]
2+
installers = "dnf,apt,apk,yum"
3+
name = "NodeJS"
4+
description = "NodeJs v12"
5+
6+
[kubectl]
7+
installers = "apt,yum,curl"
8+
name = "Kubectl"
9+
description = "kubectl controls the Kubernetes cluster manager"
10+
111
[git]
2-
name = "Git"
312
installers = "apt,yum,pacman,dnf,apk"
13+
name = "Git"
414
description = "Git SVM"
515

6-
[hello]
7-
name = "Hello"
8-
installers = "apt,yum,pacman,apk,dnf,curl"
9-
description = "This is just a sample tool"
10-
11-
[node]
12-
name = "NodeJS"
13-
installers = "apt,yum,dnf,apk"
14-
15-
[python3]
16-
name = "Python 3"
17-
description = "Python 3"
18-
installers = "apt,yum,pacman,apk,dnf"
16+
[gcloud]
17+
installers = "curl"
18+
name = "gCloud"
19+
description = "CLI tool of GCP"
1920

2021
[nginx]
22+
installers = "dnf,pacman,apt,apk,yum"
2123
name = "Nginx"
2224
description = "Nginx server"
23-
installers = "apt,yum,pacman,apk,dnf"
2425

25-
[gcloud]
26-
name = "gCloud"
27-
description = "CLI tool of GCP"
26+
[hlf]
2827
installers = "curl"
28+
name = "Fabric"
29+
description = "Hyperledger Fabric"
2930

3031
[docker]
32+
installers = "apt,yum"
3133
name = "Docker"
3234
description = "Docker"
33-
installers = "apt,yum"
3435

35-
[hlf]
36-
name = "Fabric"
37-
description = "Hyperledger Fabric"
36+
[ctop]
3837
installers = "curl"
38+
name = "cTop"
39+
description = "Top-like interface for container metrics"
40+
41+
[hello]
42+
installers = "apt,yum,pacman,apk,dnf,curl"
43+
name = "Hello"
44+
description = "This is just a sample tool"
45+
46+
[python3]
47+
installers = "apt,yum,pacman,apk,dnf"
48+
name = "Python 3"
49+
description = "Python 3"

installers/ctop/installer.min.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
;CURL_CMD=$(which curl);YUM_CMD=$(which yum);DNF_CMD=$(which dnf);APT_GET_CMD=$(which apt-get);PACMAN_CMD=$(which pacman);APK_CMD=$(which apk);GIT_CMD=$(which git);SUDO_CMD=$(which sudo);;USER="$(id -un 2>/dev/null || true)";SUDO='';if [ "$USER" != 'root' ]; then;if [ ! -z $SUDO_CMD ]; then;SUDO='sudo';else cat >&2 <<-'EOF';Error: this installer needs the ability to run commands as root.;We are unable to find "sudo". Make sure its available to make this happen;EOF;exit 1;fi;fi;;RESET='';RED='';GREEN='';YELLOW='';log () { echo "[`date "+%Y.%m.%d-%H:%M:%S%Z"`]$1 $2"; };info () { log "$GREEN INFO$RESET $1"; };warn () { log "$YELLOW WARN$RESET $1"; };error () { log "$RED ERROR$RESET $1"; };;if [ ! -z $CURL_CMD ]; then;info "Downloading cTop ........";$SUDO curl -sSL https://github.com/bcicen/ctop/releases/download/v0.7.3/ctop-0.7.3-linux-amd64 -O /usr/local/bin/ctop;info "Setting up at /usr/local/bin/ctop";$SUDO chmod +x /usr/local/bin/ctop;;else echo "Couldn't install package";exit 1;;fi;

installers/ctop/installer.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/sh
2+
3+
CURL_CMD=$(which curl)
4+
YUM_CMD=$(which yum)
5+
DNF_CMD=$(which dnf)
6+
APT_GET_CMD=$(which apt-get)
7+
PACMAN_CMD=$(which pacman)
8+
APK_CMD=$(which apk)
9+
GIT_CMD=$(which git)
10+
SUDO_CMD=$(which sudo)
11+
12+
USER="$(id -un 2>/dev/null || true)"
13+
SUDO=''
14+
if [ "$USER" != 'root' ]; then
15+
if [ ! -z $SUDO_CMD ]; then
16+
SUDO='sudo'
17+
else
18+
cat >&2 <<-'EOF'
19+
Error: this installer needs the ability to run commands as root.
20+
We are unable to find "sudo". Make sure its available to make this happen
21+
EOF
22+
exit 1
23+
fi
24+
fi
25+
26+
RESET=''
27+
RED=''
28+
GREEN=''
29+
YELLOW=''
30+
log () {
31+
echo "[`date "+%Y.%m.%d-%H:%M:%S%Z"`]$1 $2"
32+
}
33+
info () {
34+
log "$GREEN INFO$RESET $1"
35+
}
36+
warn () {
37+
log "$YELLOW WARN$RESET $1"
38+
}
39+
error () {
40+
log "$RED ERROR$RESET $1"
41+
}
42+
43+
if [ ! -z $CURL_CMD ]; then
44+
info "Downloading cTop ........"
45+
$SUDO curl -sSL https://github.com/bcicen/ctop/releases/download/v0.7.3/ctop-0.7.3-linux-amd64 -O /usr/local/bin/ctop
46+
info "Setting up at /usr/local/bin/ctop"
47+
$SUDO chmod +x /usr/local/bin/ctop
48+
49+
else
50+
echo "Couldn't install package"
51+
exit 1;
52+
fi

installers/ctop/installer.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name = "cTop"
2+
shortname = "ctop"
3+
description = "Top-like interface for container metrics"
4+
5+
6+
[curl]
7+
sh = """
8+
@info "Downloading cTop ........"
9+
@sudo curl -sSL https://github.com/bcicen/ctop/releases/download/v0.7.3/ctop-0.7.3-linux-amd64 -O /usr/local/bin/ctop
10+
@info "Setting up at /usr/local/bin/ctop"
11+
@sudo chmod +x /usr/local/bin/ctop
12+
"""

installers/eksctl/installer.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name = "eksctl"
2+
shortname = "eksctl"
3+
description = "A simple CLI tool for creating clusters on EKS"
4+
5+
6+
[curl]
7+
sh = """
8+
@info "Downloading eksctl"
9+
@sudo curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
10+
@info "Setting up at /usr/local/bin/eksctl"
11+
@sudo mv /tmp/eksctl /usr/local/bin
12+
@sudo rm /tmp/eksctl
13+
"""

installers/helm/installer.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name = "Helm"
2+
shortname = "helm"
3+
description = "The package manager for Kubernetes"
4+
5+
6+
[curl]
7+
sh = """
8+
@info "Downloading Helm"
9+
@sudo curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
10+
@sudo chmod +x get_helm.sh
11+
12+
@info "Installing"
13+
@sudo ./get_helm.sh
14+
@sudo rm ./get_helm.sh
15+
"""

installers/hlf/installer.min.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
;CURL_CMD=$(which curl);YUM_CMD=$(which yum);DNF_CMD=$(which dnf);APT_GET_CMD=$(which apt-get);PACMAN_CMD=$(which pacman);APK_CMD=$(which apk);GIT_CMD=$(which git);SUDO_CMD=$(which sudo);;USER="$(id -un 2>/dev/null || true)";SUDO='';if [ "$USER" != 'root' ]; then;if [ ! -z $SUDO_CMD ]; then;SUDO='sudo';else cat >&2 <<-'EOF';Error: this installer needs the ability to run commands as root.;We are unable to find "sudo". Make sure its available to make this happen;EOF;exit 1;fi;fi;;RESET='';RED='';GREEN='';YELLOW='';log () { echo "[`date "+%Y.%m.%d-%H:%M:%S%Z"`]$1 $2"; };info () { log "$GREEN INFO$RESET $1"; };warn () { log "$YELLOW WARN$RESET $1"; };error () { log "$RED ERROR$RESET $1"; };;if [ ! -z $CURL_CMD ]; then;if ! command -v docker;then;warn "docker could not be found";curl https://installer.to/docker | bash;else info "docker found";fi;;info "downloading Fabric........";curl -sSL http://bit.ly/2ysbOFE -o bootstrap.sh;chmod 755 ./bootstrap.sh;$SUDO bash ./bootstrap.sh;;$SUDO cp ./fabric-samples/bin/* /usr/local/bin;;;else echo "Couldn't install package";exit 1;;fi;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
;CURL_CMD=$(which curl);YUM_CMD=$(which yum);DNF_CMD=$(which dnf);APT_GET_CMD=$(which apt-get);PACMAN_CMD=$(which pacman);APK_CMD=$(which apk);GIT_CMD=$(which git);SUDO_CMD=$(which sudo);;USER="$(id -un 2>/dev/null || true)";SUDO='';if [ "$USER" != 'root' ]; then;if [ ! -z $SUDO_CMD ]; then;SUDO='sudo';else cat >&2 <<-'EOF';Error: this installer needs the ability to run commands as root.;We are unable to find "sudo". Make sure its available to make this happen;EOF;exit 1;fi;fi;;RESET='';RED='';GREEN='';YELLOW='';log () { echo "[`date "+%Y.%m.%d-%H:%M:%S%Z"`]$1 $2"; };info () { log "$GREEN INFO$RESET $1"; };warn () { log "$YELLOW WARN$RESET $1"; };error () { log "$RED ERROR$RESET $1"; };;if [ ! -z $APT_GET_CMD ]; then;$SUDO apt-get update && $SUDO apt-get install -y apt-transport-https gnupg2;curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | $SUDO apt-key add -;echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | $SUDO tee -a /etc/apt/sources.list.d/kubernetes.list;$SUDO apt-get update;$SUDO apt-get install kubectl;;elif [ ! -z $YUM_CMD ]; then;cat <<EOF > /etc/yum.repos.d/kubernetes.repo;[kubernetes];name=Kubernetes;baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64;enabled=1;gpgcheck=1;repo_gpgcheck=1;gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg;EOF;yum install -y kubectl;;elif [ ! -z $CURL_CMD ]; then;info "Downloading Helm";$SUDO curl -sSL https://storage.googleapis.com/kubernetes-release/release/v1.13.3/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl;$SUDO chmod +x /usr/local/bin/kubectl;;else echo "Couldn't install package";exit 1;;fi;

installers/kubectl/installer.sh

Lines changed: 66 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,70 @@
11
#!/bin/sh
2+
3+
CURL_CMD=$(which curl)
4+
YUM_CMD=$(which yum)
5+
DNF_CMD=$(which dnf)
6+
APT_GET_CMD=$(which apt-get)
7+
PACMAN_CMD=$(which pacman)
8+
APK_CMD=$(which apk)
9+
GIT_CMD=$(which git)
10+
SUDO_CMD=$(which sudo)
211

3-
YUM_CMD=$(which yum) # yum package manager for RHEL & CentOS
4-
DNF_CMD=$(which dnf) # dnf package manager for new RHEL & CentOS
5-
APT_GET_CMD=$(which apt-get) # apt package manager for Ubuntu & other Debian based distributions
6-
PACMAN_CMD=$(which pacman) # pacman package manager for ArchLinux
7-
APK_CMD=$(which apk) # apk package manager for Alpine
12+
USER="$(id -un 2>/dev/null || true)"
13+
SUDO=''
14+
if [ "$USER" != 'root' ]; then
15+
if [ ! -z $SUDO_CMD ]; then
16+
SUDO='sudo'
17+
else
18+
cat >&2 <<-'EOF'
19+
Error: this installer needs the ability to run commands as root.
20+
We are unable to find "sudo". Make sure its available to make this happen
21+
EOF
22+
exit 1
23+
fi
24+
fi
825

9-
if [ ! -z $APT_GET_CMD ]; then
10-
sudo apt-get update && sudo apt-get install -y apt-transport-https
11-
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
12-
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
13-
sudo apt-get update
14-
sudo apt-get install -y kubectl
15-
elif [ ! -z $YUM_CMD ]; then
16-
sudo cat <<EOF > /etc/yum.repos.d/kubernetes.repo
17-
[kubernetes]
18-
name=Kubernetes
19-
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
20-
enabled=1
21-
gpgcheck=1
22-
repo_gpgcheck=1
23-
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
24-
EOF
25-
sudo yum install -y kubectl
26-
elif [ ! -z $APK_CMD ]; then
27-
sudo apk add --no-cache curl ca-certificates && sudo apk add --update -t deps curl
28-
curl -L https://storage.googleapis.com/kubernetes-release/release/v1.13.3/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl
29-
chmod +x /usr/local/bin/kubectl
30-
else
31-
echo "Couldn't install package"
32-
exit 1;
33-
fi
26+
RESET=''
27+
RED=''
28+
GREEN=''
29+
YELLOW=''
30+
log () {
31+
echo "[`date "+%Y.%m.%d-%H:%M:%S%Z"`]$1 $2"
32+
}
33+
info () {
34+
log "$GREEN INFO$RESET $1"
35+
}
36+
warn () {
37+
log "$YELLOW WARN$RESET $1"
38+
}
39+
error () {
40+
log "$RED ERROR$RESET $1"
41+
}
3442

35-
kubectl version
43+
if [ ! -z $APT_GET_CMD ]; then
44+
$SUDO apt-get update && $SUDO apt-get install -y apt-transport-https gnupg2
45+
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | $SUDO apt-key add -
46+
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | $SUDO tee -a /etc/apt/sources.list.d/kubernetes.list
47+
$SUDO apt-get update
48+
$SUDO apt-get install kubectl
49+
50+
elif [ ! -z $YUM_CMD ]; then
51+
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
52+
[kubernetes]
53+
name=Kubernetes
54+
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
55+
enabled=1
56+
gpgcheck=1
57+
repo_gpgcheck=1
58+
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
59+
EOF
60+
yum install -y kubectl
61+
62+
elif [ ! -z $CURL_CMD ]; then
63+
info "Downloading Helm"
64+
$SUDO curl -sSL https://storage.googleapis.com/kubernetes-release/release/v1.13.3/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl
65+
$SUDO chmod +x /usr/local/bin/kubectl
66+
67+
else
68+
echo "Couldn't install package"
69+
exit 1;
70+
fi

0 commit comments

Comments
 (0)