Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions hack/install-edge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ if [ "$EUID" -ne 0 ]; then
exit
fi

has_yum() {
[ -n "$(command -v yum)" ]
has_dnf() {
[ -n "$(command -v dnf)" ]
}

has_apt_get() {
Expand All @@ -37,9 +37,8 @@ install_required_packages() {
# reference: https://github.com/openfaas/faasd/pull/237
apt-get update -yq
apt-get install -yq curl runc bridge-utils iptables iptables-persistent
elif $(has_yum); then
yum check-update -y
yum install -y curl runc iptables-services which
elif $(has_dnf); then
dnf install -y curl runc iptables-services which
elif $(has_pacman); then
pacman -Syy
pacman -Sy curl runc bridge-utils
Expand All @@ -60,6 +59,7 @@ if [ -z "$SKIP_OS" ]; then
install_required_packages
fi

echo ""
echo "2. Downloading OCI image, and installing pre-requisites"
echo ""
if [ ! -x "$(command -v arkade)" ]; then
Expand Down Expand Up @@ -95,6 +95,17 @@ ${BINLOCATION}arkade oci install --path ${tmpdir} \
cd ${tmpdir}
./install.sh ./

if has_dnf; then
isRhelLike=true
else
isRhelLike=false
fi

binaryName="faasd"
if [ "$isRhelLike" = true ]; then
binaryName="/usr/local/bin/faasd"
fi

echo ""
echo "3.1 Commercial users can create their license key as follows:"
echo ""
Expand All @@ -103,12 +114,12 @@ echo "sudo nano /var/lib/faasd/secrets/openfaas_license"
echo ""
echo "3.2 For personal, non-commercial use only, GitHub Sponsors of @openfaas (25USD+) can run:"
echo ""
echo "sudo -E faasd github login"
echo "sudo -E faasd activate"
echo "sudo -E ${binaryName} github login"
echo "sudo -E ${binaryName} activate"
echo ""
echo "4. Then perform the final installation steps"
echo ""
echo "sudo -E sh -c \"cd ${tmpdir}/var/lib/faasd && faasd install\""
echo "sudo -E sh -c \"cd ${tmpdir}/var/lib/faasd && ${binaryName} install\""
echo ""
echo "5. Refer to the complete handbook and supplementary documentation at:"
echo ""
Expand Down