Skip to content

Commit

Permalink
Merge pull request #36 from Heshdude/update-readme-md-and-installers-…
Browse files Browse the repository at this point in the history
…toml-#35

Update installer scrits, README.md & installers.toml
  • Loading branch information
Heshdude authored Aug 16, 2020
2 parents ecbc05c + 2f717d4 commit 867d50d
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This will install Git on your machine!
|Nginx |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/nginx |
|Fabric |No |No |No |No |No |Yes |https://installer.to/hlf |
|Docker |Yes|Yes|No |No |No |No |https://installer.to/docker |
|eksctl |No |No |No |No |No |Yes |https://installer.to/eksctl |
|cTop |No |No |No |No |No |Yes |https://installer.to/ctop |
|Hello |Yes|Yes|Yes |Yes|Yes|Yes |https://installer.to/hello |
|Python 3|Yes|Yes|Yes |Yes|Yes|No |https://installer.to/python3|
Expand Down
5 changes: 5 additions & 0 deletions installers.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ installers = "apt,yum"
name = "Docker"
description = "Docker"

[eksctl]
installers = "curl"
name = "eksctl"
description = "A simple CLI tool for creating clusters on EKS"

[ctop]
installers = "curl"
name = "cTop"
Expand Down
2 changes: 2 additions & 0 deletions installers/eksctl/installer.min.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
;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 eksctl";$SUDO curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp;info "Setting up at /usr/local/bin/eksctl";$SUDO mv /tmp/eksctl /usr/local/bin;$SUDO rm /tmp/eksctl;;else echo "Couldn't install package";exit 1;;fi;
53 changes: 53 additions & 0 deletions installers/eksctl/installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh

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 eksctl"
$SUDO curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
info "Setting up at /usr/local/bin/eksctl"
$SUDO mv /tmp/eksctl /usr/local/bin
$SUDO rm /tmp/eksctl

else
echo "Couldn't install package"
exit 1;
fi

0 comments on commit 867d50d

Please sign in to comment.