Commit 1e1e7112 authored by Owain Jones's avatar Owain Jones
Browse files

added stuff for HHVM, automatically set up github api key variables for composer and bower

parent ece59d23
......@@ -40,6 +40,8 @@ git clone git@gitlab.noc.soton.ac.uk:owanes/gliders-website.git
# then fetch all our log files and parse them!
cd gliders-tools
python setup.py install
sudo cp fetchlogs.service /etc/systemd/system/
sudo systemctl enable fetchlogs
echo "please enter your mysql root user password"
read -s pass
......@@ -48,11 +50,21 @@ echo "CREATE USER 'gliders'@'%' IDENTIFIED BY '"$pass"' ;" | mysql -u root -p$pa
echo "GRANT ALL ON gliders.* TO 'gliders'@'%';" | mysql -u root -p$pass
cd bin
sh migrate_data.sh
sudo systemctl start fetchlogs
# Set up a GitHub API key and add it to .bash_profile
# export API_KEY=...
echo "Deploying the website requires interacting with GitHub a lot."
echo "We need a GitHub API Key so we don't go over the public limits."
echo "Please go to: https://github.com/settings/tokens/new?scopes=repo&description=`hostname`"
echo "Generate the token and then paste it into the prompt below."
read -p "Token: " GITHUB_API_KEY
echo "export GITHUB_API_KEY=$GITHUB_API_KEY" >> ~/.bashrc
echo "export BOWERPHP_TOKEN=$GITHUB_API_KEY" >> ~/.bashrc
composer config -g github-oauth.github.com $GITHUB_API_KEY
export BOWERPHP_TOKEN=$GITHUB_API_KEY
# Deploy the website
cd /home/gliders/code/gliders-website
sh bin/deploy.sh /var/gliders/www_dev dev
sh bin/deploy.sh /var/gliders/www prod
\ No newline at end of file
sh bin/deploy.sh /var/gliders/www prod
[Unit]
Description=HHVM HipHop Virtual Machine (FCGI)
[Service]
ExecStartPre=/bin/mkdir -p /var/run/hhvm
ExecStartPre=/bin/chown -R gliders:nginx /var/run/hhvm
ExecStart=/usr/local/bin/hhvm --user gliders --mode daemon -d hhvm.server.type=fastcgi -d hhvm.server.file_socket=/var/run/hhvm/sock
[Install]
WantedBy=multi-user.target
......@@ -123,3 +123,19 @@ systemctl enable haveged
# Enable SystemD User services to start automatically on machine
# boot and continue running even if the user never logs in...
loginctl enable-linger gliders
# (optional) Compile HHVM -- this will take ages!
# yum install cpp gcc-c++ cmake git psmisc {binutils,boost,jemalloc}-devel \
# {ImageMagick,sqlite,tbb,bzip2,openldap,readline,elfutils-libelf,gmp,lz4,pcre}-devel \
# lib{xslt,event,yaml,vpx,png,zip,icu,mcrypt,memcached,cap,dwarf}-devel \
# {unixODBC,expat,mariadb}-devel lib{edit,curl,xml2,xslt}-devel \
# glog-devel oniguruma-devel ocaml gperf enca libjpeg-turbo-devel openssl-devel \
# mariadb mariadb-server make -y
# git clone https://github.com/facebook/hhvm -b master hhvm --recursive
# cd hhvm
# cmake .
# make -j4
# make install
# cd -
# cp hhvm.service /etc/systemd/system/
# systemctl enable hhvm
......@@ -39,6 +39,10 @@ http {
server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
}
upstream hhvmfcgi {
server unix:/var/run/hhvm/sock;
}
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment