From 02709597a284e8b83c4ed67a1d01f774343d82e1 Mon Sep 17 00:00:00 2001 From: Adriano Vieira Date: Sat, 4 Nov 2017 22:13:19 -0200 Subject: [PATCH 1/2] Update bootstrap for centos box --- bootstrap.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index 92a8d746..f65ba6e2 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,4 +1,10 @@ #!/bin/bash + +# set env os release variables +. /etc/os-release + +if [[ "$ID" == "opensuse" ]]; then + pushd /vagrant echo -e "\ninstalling required software packages...\n" @@ -14,6 +20,37 @@ echo 'install: --no-format-executable' >> /etc/gemrc echo -e "\ninstalling bundler...\n" gem.ruby2.4 install bundler +elif [[ "$ID" == "centos" || "$VERSION" == "7" ]]; then + _YELLOW='\033[1;33m' # yellow color + _LRED='\033[1;31m' # Light red color + _NO_COLOUR='\033[0m' # no color + + printf "${_YELLOW}CEntOS-7 Setup${_NO_COLOUR}\n" + + printf "${_YELLOW}installing ruby-2.4${_NO_COLOUR}\n" + yum install -q -y https://github.com/feedforce/ruby-rpm/releases/download/2.4.2/ruby-2.4.2-1.el7.centos.x86_64.rpm + if [[ ! "$?" -eq 0 ]]; then + printf "${_LRED}Error trying to install ruby-2.4${_NO_COLOUR}\n" + fi + + printf "${_YELLOW}installing ruby-2.4 gems dependencies${_NO_COLOUR}\n" + gem install bundler + if [[ ! "$?" -eq 0 ]]; then + printf "${_LRED}Error trying to install ruby-2.4 bundler${_NO_COLOUR}\n" + fi + + printf "${_YELLOW}installing nodejs repo${_NO_COLOUR}\n" + curl -sL https://rpm.nodesource.com/setup_9.x | bash - > /dev/null + + printf "${_YELLOW}installing nodejs and devel tools${_NO_COLOUR}\n" + yum install -q -y git make gcc gcc-c++ libxml2-devel libxslt-devel nodejs screen mariadb mariadb-devel sqlite-devel ImageMagick + + # for production: bundle install --without test development + printf "${_YELLOW}Opening firewall port: 3000${_NO_COLOUR}\n" + iptables -I INPUT -p tcp --dport 3000 -j ACCEPT + +fi + echo -e "\ninstalling your bundle...\n" su - vagrant -c "cd /vagrant/; bundle install --quiet" From c4fad4a181b1f10e961b342ff42c8a96933a008d Mon Sep 17 00:00:00 2001 From: Adriano Vieira Date: Sun, 5 Nov 2017 00:55:07 -0200 Subject: [PATCH 2/2] Update bootstrap to install phantomjs on centos --- bootstrap.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index f65ba6e2..06a642dd 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -43,12 +43,17 @@ elif [[ "$ID" == "centos" || "$VERSION" == "7" ]]; then curl -sL https://rpm.nodesource.com/setup_9.x | bash - > /dev/null printf "${_YELLOW}installing nodejs and devel tools${_NO_COLOUR}\n" - yum install -q -y git make gcc gcc-c++ libxml2-devel libxslt-devel nodejs screen mariadb mariadb-devel sqlite-devel ImageMagick + yum install -q -y git make gcc gcc-c++ libxml2-devel libxslt-devel nodejs screen mariadb mariadb-devel sqlite-devel ImageMagick bzip2 # for production: bundle install --without test development printf "${_YELLOW}Opening firewall port: 3000${_NO_COLOUR}\n" iptables -I INPUT -p tcp --dport 3000 -j ACCEPT + printf "${_YELLOW}installing phantomjs${_NO_COLOUR}\n" + curl -L --silent https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -o /tmp/phantomjs-2.1.1-linux-x86_64.tar.bz2 + tar jxvf /tmp/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C /tmp/ phantomjs-2.1.1-linux-x86_64/bin/phantomjs + mv /tmp/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin + fi echo -e "\ninstalling your bundle...\n"