Skip to content
This repository was archived by the owner on Dec 9, 2019. It is now read-only.

Commit 34ed5a9

Browse files
committed
CentOS 7
1 parent 8598420 commit 34ed5a9

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Vagrant.configure("2") do |config|
2+
config.vm.box = "centos/7"
3+
4+
config.vm.synced_folder "../../../../", "/home/vagrant/cpriego-valet-linux", type: "rsync"
5+
6+
config.vm.provision "shell" do |s|
7+
s.path = "provision.sh"
8+
s.privileged = false
9+
s.env = {
10+
VALET_ENVIRONMENT: ENV['VALET_ENVIRONMENT'] || "testing"
11+
}
12+
end
13+
end
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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

Comments
 (0)