hugo-sandstorm/.sandstorm/setup.sh

56 lines
1.5 KiB
Bash
Raw Normal View History

2016-10-11 08:58:23 +00:00
#!/bin/bash
# When you change this file, you must take manual action. Read this doc:
# - https://docs.sandstorm.io/en/latest/vagrant-spk/customizing/#setupsh
set -euo pipefail
2020-04-10 11:29:40 +00:00
export HUGO_VERSION=0.68.3
export NODE_VERSION=10
2016-10-11 08:58:23 +00:00
apt-get update
2020-04-10 11:29:40 +00:00
apt-get install -y git strace
2016-10-11 08:58:23 +00:00
# First, get capnproto from master and install it to
2020-04-10 11:29:40 +00:00
# /usr/local/bin. This requires a C++ compiler. We opt for gcc-6
# because that's what capnproto now requires.
2016-10-11 08:58:23 +00:00
if [ ! -e /usr/local/bin/capnp ] ; then
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -q clang autoconf pkg-config libtool
cd /tmp
2020-04-10 11:29:40 +00:00
if [ ! -e capnproto ]; then git clone https://github.com/capnproto/capnproto; fi
2016-10-11 08:58:23 +00:00
cd capnproto
2020-04-10 11:29:40 +00:00
#git checkout master
git checkout master
2016-10-11 08:58:23 +00:00
cd c++
2020-04-10 11:29:40 +00:00
make clean || true
2016-10-11 08:58:23 +00:00
autoreconf -i
./configure
make -j2
sudo make install
fi
2020-04-10 11:29:40 +00:00
rm /opt/app/sandstorm-integration/getPublicId || true
rm -Rf /opt/app/sandstorm-integration/tmp || true
2016-10-11 08:58:23 +00:00
# Second, compile the small C++ program within
# /opt/app/sandstorm-integration.
if [ ! -e /opt/app/sandstorm-integration/getPublicId ] ; then
pushd /opt/app/sandstorm-integration
2020-04-10 11:29:40 +00:00
make clean || true
2016-10-11 08:58:23 +00:00
make
fi
cp /opt/app/sandstorm-integration/bin/getPublicId /usr/local/bin
2020-04-10 11:29:40 +00:00
curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo -E bash -
2016-10-11 08:58:23 +00:00
apt-get install -y nodejs
npm install -g yarn
2016-10-11 08:58:23 +00:00
apt-get install -y python-pip asciidoctor
pip install pygments
2016-10-11 08:58:23 +00:00
cd /tmp
2020-04-10 11:29:40 +00:00
wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.deb -O hugo.deb
2016-10-11 08:58:23 +00:00
dpkg -i hugo.deb
rm hugo.deb