|
| 1 | +#!/bin/bash |
| 2 | +set -e |
| 3 | + |
| 4 | +# Enable remirepo |
| 5 | +sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
| 6 | +sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm |
| 7 | +sudo yum -y install yum-utils |
| 8 | +sudo yum-config-manager --enable remi-php56 |
| 9 | + |
| 10 | +# Install OS Requirements |
| 11 | +sudo yum install -y nss-tools jq xsel |
| 12 | + |
| 13 | +# Install Nginx & PHP |
| 14 | +sudo yum install -y nginx curl zip unzip git \ |
| 15 | + php-fpm php-cli php-mcrypt php-mbstring php-xml php-curl php-posix |
| 16 | + |
| 17 | +# Install Composer |
| 18 | +php -r "readfile('http://getcomposer.org/installer');" | sudo php -- --install-dir=/usr/bin/ --filename=composer |
| 19 | + |
| 20 | +# Remove .composer directory created during installation |
| 21 | +sudo rm -rf ~/.composer |
| 22 | + |
| 23 | +# Configure Composer |
| 24 | +mkdir -p ~/.config/composer |
| 25 | +if [ "$VALET_ENVIRONMENT" == "testing" ] |
| 26 | +then |
| 27 | + # If we are testing, we mirror the repository |
| 28 | + # so the shared folder stays untouched |
| 29 | + echo '{ |
| 30 | + "minimum-stability": "dev", |
| 31 | + "repositories": [ |
| 32 | + { |
| 33 | + "type": "path", |
| 34 | + "url": "/home/vagrant/cpriego-valet-linux", |
| 35 | + "options": { |
| 36 | + "symlink": false |
| 37 | + } |
| 38 | + } |
| 39 | + ] |
| 40 | + }' >> ~/.config/composer/composer.json |
| 41 | +else |
| 42 | + # If we are developing, we sync the repository with the shared folder |
| 43 | + echo '{ |
| 44 | + "minimum-stability": "dev", |
| 45 | + "repositories": [ |
| 46 | + { |
| 47 | + "type": "path", |
| 48 | + "url": "/home/vagrant/cpriego-valet-linux" |
| 49 | + } |
| 50 | + ] |
| 51 | + }' >> ~/.config/composer/composer.json |
| 52 | +fi |
| 53 | + |
| 54 | +# Require Valet |
| 55 | +composer global require "cpriego/valet-linux @dev" --no-interaction --no-ansi |
| 56 | + |
| 57 | +# Add Composer bin to PATH |
| 58 | +echo "PATH=\"\$HOME/.config/composer/vendor/bin:\$PATH\"" >> ~/.bashrc |
| 59 | +source ~/.bashrc |
| 60 | + |
| 61 | +# Disable SELinux |
| 62 | +sudo setenforce 0 |
| 63 | +sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config |
0 commit comments