Skip to content
This repository was archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
First commit of new repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Swader committed Sep 6, 2015
0 parents commit 95926b8
Show file tree
Hide file tree
Showing 35 changed files with 1,480 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor
/.vagrant
33 changes: 33 additions & 0 deletions Homestead.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

folders:
- map: /Users/swader/vagrant_boxes/homestead/homestead_original
to: /home/vagrant/Code

sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public

databases:
- homestead

variables:
- key: APP_ENV
value: local

# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar

# ports:
# - send: 93000
# to: 9300
# - send: 7777
# to: 777
# protocol: udp
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) <Taylor Otwell>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
28 changes: 28 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION = "2"
confDir = $confDir ||= File.expand_path(".")

homesteadYamlPath = confDir + "/Homestead.yaml"
homesteadJsonPath = confDir + "/Homestead.json"
afterScriptPath = confDir + "/after.sh"
aliasesPath = confDir + "/aliases"

require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb')

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if File.exists? aliasesPath then
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
end

if File.exists? homesteadYamlPath then
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
elsif File.exists? homesteadJsonPath then
Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath)))
end

if File.exists? afterScriptPath then
config.vm.provision "shell", path: afterScriptPath
end
end
5 changes: 5 additions & 0 deletions after.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
33 changes: 33 additions & 0 deletions aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
alias ..="cd .."
alias ...="cd ../.."

alias h='cd ~'
alias c='clear'
alias artisan='php artisan'

alias phpspec='vendor/bin/phpspec'
alias phpunit='vendor/bin/phpunit'

function serve() {
if [[ "$1" && "$2" ]]
then
sudo dos2unix /vagrant/scripts/serve.sh
sudo bash /vagrant/scripts/serve.sh "$1" "$2" 80
else
echo "Error: missing required parameters."
echo "Usage: "
echo " serve domain path"
fi
}

function serve-hhvm() {
if [[ "$1" && "$2" ]]
then
sudo dos2unix /vagrant/scripts/serve-hhvm.sh
sudo bash /vagrant/scripts/serve-hhvm.sh "$1" "$2" 80
else
echo "Error: missing required parameters."
echo "Usage: "
echo " serve-hhvm domain path"
fi
}
16 changes: 16 additions & 0 deletions bin/folderfix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

if [ "$(uname)" == "Darwin" ]
then
# Mac OSX
sed -i '' "s@map\: \.@map\: $PWD@g" Homestead.yaml
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]
then
sed -i "s@map\: \.@map\: $PWD@g" Homestead.yaml
elif [ -n "$COMSPEC" -a -x "$COMSPEC" ]
then
var=$PWD
sub=${var:1:1}
workdir=${var/$sub/":/"};
sed -i "s@map\: \.@map\: $workdir@g" Homestead.yaml
fi
24 changes: 24 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "laravel/homestead",
"description": "A virtual machine for web artisans.",
"require": {
"php": ">=5.4",
"symfony/console": "~2.0",
"symfony/process": "~2.0"
},
"license": "MIT",
"authors": [
{
"name": "Taylor Otwell",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"Laravel\\Homestead\\": "src/"
}
},
"bin": [
"homestead"
]
}
124 changes: 124 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions homestead
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env php
<?php

$_ENV['HOME'] = getenv('HOME');
$_ENV['VAGRANT_DOTFILE_PATH'] = homestead_path().DIRECTORY_SEPARATOR.'.vagrant';

if (file_exists(__DIR__.'/vendor/autoload.php')) {
require __DIR__.'/vendor/autoload.php';
} else {
require __DIR__.'/../../autoload.php';
}

function homestead_path()
{
if (isset($_SERVER['HOME'])) {
return $_SERVER['HOME'].'/.homestead';
} else {
return $_SERVER['HOMEDRIVE'].$_SERVER['HOMEPATH'].DIRECTORY_SEPARATOR.'.homestead';
}
}

$app = new Symfony\Component\Console\Application('Laravel Homestead', '2.1.7');

$app->add(new Laravel\Homestead\DestroyCommand);
$app->add(new Laravel\Homestead\EditCommand);
$app->add(new Laravel\Homestead\HaltCommand);
$app->add(new Laravel\Homestead\InitCommand);
$app->add(new Laravel\Homestead\MakeCommand);
$app->add(new Laravel\Homestead\ProvisionCommand);
$app->add(new Laravel\Homestead\ResumeCommand);
$app->add(new Laravel\Homestead\RunCommand);
$app->add(new Laravel\Homestead\UpCommand);
$app->add(new Laravel\Homestead\UpdateCommand);
$app->add(new Laravel\Homestead\SshCommand);
$app->add(new Laravel\Homestead\SshConfigCommand);
$app->add(new Laravel\Homestead\StatusCommand);
$app->add(new Laravel\Homestead\SuspendCommand);

$app->run();
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Homestead Improved

A fork of the original Laravel Homestead, this improved version aims to make things even simpler.
See full explanation with quickstart tutorial [here](http://www.sitepoint.com/quick-tip-get-homestead-vagrant-vm-running/).
29 changes: 29 additions & 0 deletions scripts/blackfire.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

agent="[blackfire]
ca-cert=
collector=https://blackfire.io
log-file=stderr
log-level=1
server-id="$1"
server-token="$2"
socket=unix:///var/run/blackfire/agent.sock
spec=
"

client="[blackfire]
ca-cert=
client-id="$3"
client-token="$4"
endpoint=https://blackfire.io
timeout=15s
"

echo "$agent" > "/etc/blackfire/agent"
echo "$client" > "/home/vagrant/.blackfire.ini"

# Disable xdebug to prevent conflict
php5dismod xdebug
service hhvm restart
service php5-fpm restart
service blackfire-agent restart
4 changes: 4 additions & 0 deletions scripts/clear-nginx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Clear The Old Nginx Sites

rm -f /etc/nginx/sites-enabled/*
rm -f /etc/nginx/sites-available/*
4 changes: 4 additions & 0 deletions scripts/clear-variables.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Clear The Old Environment Variables

sed -i '/# Set Homestead Environment Variable/,+1d' /home/vagrant/.profile
sed -i '/env\[.*/,+1d' /etc/php5/fpm/php-fpm.conf
5 changes: 5 additions & 0 deletions scripts/create-mysql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

DB=$1;

mysql -uhomestead -psecret -e "CREATE DATABASE IF NOT EXISTS \`$DB\` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci";
5 changes: 5 additions & 0 deletions scripts/create-postgres.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

DB=$1;
# su postgres -c "dropdb $DB --if-exists"
su postgres -c "createdb -O homestead '$DB' || true"
Loading

0 comments on commit 95926b8

Please sign in to comment.