add production2 env for testing new servers
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
# Run: curl -L -s https://raw.githubusercontent.com/r888888888/danbooru/master/INSTALL.debian -o install.sh ; chmod +x install.sh ; ./install.sh
|
||||
|
||||
export RUBY_VERSION=2.5.1
|
||||
export GITHUB_INSTALL_SCRIPTS=https://raw.githubusercontent.com/r888888888/danbooru/master/script/install
|
||||
export VIPS_VERSION=8.7.0
|
||||
|
||||
if [[ "$(whoami)" != "root" ]] ; then
|
||||
echo "You must run this script as root"
|
||||
exit 1
|
||||
@@ -28,20 +32,54 @@ if [[ -z "$HOSTNAME" ]] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export RUBY_VERSION=2.5.1
|
||||
export GITHUB_INSTALL_SCRIPTS=https://raw.githubusercontent.com/r888888888/danbooru/master/script/install
|
||||
echo -n "* Enter the VLAN IP address for this server (ex: 172.16.0.1, enter nothing to skip): "
|
||||
read VLAN_IP_ADDR
|
||||
|
||||
# Install packages
|
||||
echo "* Installing packages..."
|
||||
LIBSSL_DEV_PKG=$( verlt `lsb_release -sr` 9.0 && echo libssl-dev || echo libssl1.0-dev )
|
||||
|
||||
if [ -n "$(uname -a | grep Ubuntu)" ] ; then
|
||||
LIBSSL_DEV_PKG=libssl-dev
|
||||
else
|
||||
LIBSSL_DEV_PKG=$( verlt `lsb_release -sr` 9.0 && echo libssl-dev || echo libssl1.0-dev )
|
||||
fi
|
||||
apt-get update
|
||||
apt-get -y install build-essential automake $LIBSSL_DEV_PKG libxml2-dev libxslt-dev ncurses-dev sudo libreadline-dev flex bison ragel memcached libmemcached-dev git curl libcurl4-openssl-dev libvips-dev libvips-tools sendmail-bin sendmail postgresql postgresql-contrib libpq-dev postgresql-server-dev-all nginx ssh coreutils ffmpeg mkvtoolnix libvips42 libvips-tools libvips-dev
|
||||
apt-get -y install $LIBSSL_DEV_PKG build-essential automake libxml2-dev libxslt-dev ncurses-dev sudo libreadline-dev flex bison ragel memcached libmemcached-dev git curl libcurl4-openssl-dev sendmail-bin sendmail nginx ssh coreutils ffmpeg mkvtoolnix
|
||||
apt-get -y install libpq-dev postgresql-client
|
||||
apt-get -y install libjpeg-turbo8-dev libexpat1-dev libgif-dev libpng-dev libexif-dev
|
||||
|
||||
# vrack specific stuff
|
||||
if [ -n "$VLAN_IP_ADDR" ] ; then
|
||||
apt-get -y install vlan
|
||||
modprobe 8021q
|
||||
echo "8021q" >> /etc/modules
|
||||
vconfig add eno2 99
|
||||
ip addr add $VLAN_IP_ADDR/24 dev eno2.99
|
||||
ip link set up eno2.99
|
||||
curl -L -s $GITHUB_INSTALL_SCRIPTS/vrack-cfg.yaml -o /etc/netplan/01-netcfg.yaml
|
||||
fi
|
||||
|
||||
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
||||
curl -sSL https://deb.nodesource.com/setup_10.x | sudo -E bash -
|
||||
apt-get update
|
||||
apt-get -y install nodejs yarn
|
||||
apt-get remove cmdtest
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "* Error installing packages; aborting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# compile and install libvips (the version in apt is too old)
|
||||
cd /tmp
|
||||
wget -q https://github.com/libvips/libvips/releases/download/v$VIPS_VERSION/vips-$VIPS_VERSION.tar.gz
|
||||
tar xzf vips-$VIPS_VERSION.tar.gz
|
||||
cd vips-$VIPS_VERSION
|
||||
./configure --prefix=/usr
|
||||
make install
|
||||
ldconfig
|
||||
|
||||
# Create user account
|
||||
useradd -m danbooru
|
||||
chsh -s /bin/bash danbooru
|
||||
@@ -58,7 +96,7 @@ fi
|
||||
|
||||
# Install rbenv
|
||||
echo "* Installing rbenv..."
|
||||
cd /
|
||||
cd /tmp
|
||||
sudo -u danbooru git clone git://github.com/sstephenson/rbenv.git ~danbooru/.rbenv
|
||||
sudo -u danbooru touch ~danbooru/.bash_profile
|
||||
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~danbooru/.bash_profile
|
||||
|
||||
Reference in New Issue
Block a user