Support CentOS in bootstrap.sh
This commit is contained in:
1 parent
dc879e2c4a
commit
537906c504
2 files changed
+71
-9
No files matched your search
Vendored
+9
@@ -76,6 +76,15 @@ Vagrant::configure("2") do |config|
|
|||||||
vm.vm.provision :shell, :inline => "cd /root/dokku && make install-from-deb"
|
vm.vm.provision :shell, :inline => "cd /root/dokku && make install-from-deb"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config.vm.define "dokku-rpm", autostart: false do |vm|
|
||||||
|
vm.vm.box = "centos/7"
|
||||||
|
vm.vm.synced_folder File.dirname(__FILE__), "/root/dokku"
|
||||||
|
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
|
||||||
|
vm.vm.hostname = "#{DOKKU_DOMAIN}"
|
||||||
|
vm.vm.network :private_network, ip: DOKKU_IP
|
||||||
|
vm.vm.provision :shell, :inline => "cd /root/dokku && bash bootstrap.sh"
|
||||||
|
end
|
||||||
|
|
||||||
config.vm.define "build", autostart: false do |vm|
|
config.vm.define "build", autostart: false do |vm|
|
||||||
vm.vm.synced_folder File.dirname(__FILE__), "/root/dokku"
|
vm.vm.synced_folder File.dirname(__FILE__), "/root/dokku"
|
||||||
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
|
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
|
||||||
|
|||||||
+62
-9
@@ -14,10 +14,6 @@ set -eo pipefail; [[ $TRACE ]] && set -x
|
|||||||
ensure-environment() {
|
ensure-environment() {
|
||||||
local FREE_MEMORY
|
local FREE_MEMORY
|
||||||
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
|
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
|
||||||
if ! command -v apt-get &>/dev/null; then
|
|
||||||
echo "This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
hostname -f > /dev/null 2>&1 || {
|
hostname -f > /dev/null 2>&1 || {
|
||||||
echo "This installation script requires that you have a hostname set for the instance. Please set a hostname for 127.0.0.1 in your /etc/hosts"
|
echo "This installation script requires that you have a hostname set for the instance. Please set a hostname for 127.0.0.1 in your /etc/hosts"
|
||||||
@@ -33,10 +29,15 @@ ensure-environment() {
|
|||||||
|
|
||||||
install-requirements() {
|
install-requirements() {
|
||||||
echo "--> Ensuring we have the proper dependencies"
|
echo "--> Ensuring we have the proper dependencies"
|
||||||
apt-get update -qq > /dev/null
|
|
||||||
if [[ $(lsb_release -sr) == "12.04" ]]; then
|
case "$DOKKU_DISTRO" in
|
||||||
apt-get -qq -y install python-software-properties
|
debian|ubuntu)
|
||||||
fi
|
apt-get update -qq > /dev/null
|
||||||
|
if [[ "$DOKKU_DISTRO_VERSION" == "12.04" ]]; then
|
||||||
|
apt-get -qq -y install python-software-properties
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
install-dokku() {
|
install-dokku() {
|
||||||
@@ -68,9 +69,14 @@ install-dokku() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
install-dokku-from-source() {
|
install-dokku-from-source() {
|
||||||
local DOKKU_CHECKOUT="$1"
|
local DOKKU_CHECKOUT="$1"
|
||||||
|
|
||||||
|
if ! command -v apt-get &>/dev/null; then
|
||||||
|
echo "This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
apt-get -qq -y install git make software-properties-common
|
apt-get -qq -y install git make software-properties-common
|
||||||
cd /root
|
cd /root
|
||||||
if [[ ! -d /root/dokku ]]; then
|
if [[ ! -d /root/dokku ]]; then
|
||||||
@@ -84,6 +90,21 @@ install-dokku-from-source() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
install-dokku-from-package() {
|
install-dokku-from-package() {
|
||||||
|
case "$DOKKU_DISTRO" in
|
||||||
|
debian|ubuntu)
|
||||||
|
install-dokku-from-deb-package "$@"
|
||||||
|
;;
|
||||||
|
centos)
|
||||||
|
install-dokku-from-rpm-package "$@"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported Linux distribution. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
install-dokku-from-deb-package() {
|
||||||
local DOKKU_CHECKOUT="$1"
|
local DOKKU_CHECKOUT="$1"
|
||||||
local NO_INSTALL_RECOMMENDS=${DOKKU_NO_INSTALL_RECOMMENDS:=""}
|
local NO_INSTALL_RECOMMENDS=${DOKKU_NO_INSTALL_RECOMMENDS:=""}
|
||||||
|
|
||||||
@@ -124,7 +145,39 @@ install-dokku-from-package() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install-dokku-from-rpm-package() {
|
||||||
|
local DOKKU_CHECKOUT="$1"
|
||||||
|
|
||||||
|
if [[ "$DOKKU_DISTRO_VERSION" != "7" ]]; then
|
||||||
|
echo "Only CentOS version 7 is supported."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "--> Installing docker"
|
||||||
|
curl -fsSL https://get.docker.com/ | sh
|
||||||
|
|
||||||
|
echo "--> Installing epel for nginx packages to be available"
|
||||||
|
yum install -y epel-release
|
||||||
|
|
||||||
|
echo "--> Installing herokuish and dokku"
|
||||||
|
curl -s https://packagecloud.io/install/repositories/dokku/dokku/script.rpm.sh | bash
|
||||||
|
if [[ -n $DOKKU_CHECKOUT ]]; then
|
||||||
|
yum -y install herokuish "dokku-$DOKKU_CHECKOUT"
|
||||||
|
else
|
||||||
|
yum -y install herokuish dokku
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "--> Starting nginx"
|
||||||
|
systemctl start nginx
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
export DOKKU_DISTRO DOKKU_DISTRO_VERSION
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
DOKKU_DISTRO=$(. /etc/os-release && echo "$ID")
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
DOKKU_DISTRO_VERSION=$(. /etc/os-release && echo "$VERSION_ID")
|
||||||
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/dokku/dokku.git"}
|
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/dokku/dokku.git"}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user