Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Add local composer; update migrations; fix setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
EivindArvesen committed Aug 14, 2016
1 parent 9fb4eae commit 44f0e93
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Binary file added composer.phar
Binary file not shown.
2 changes: 1 addition & 1 deletion database/seeds/BlogTablesSeeder.php
Expand Up @@ -21,7 +21,7 @@ public function run()
// update tables instead of overwriting (think timestamps, original...)

$parser = new DocumentParser;
$it = new RecursiveDirectoryIterator(realpath("./storage/app/blog"));
$it = new RecursiveDirectoryIterator(realpath(dirname(dirname(dirname(__FILE__)))."/storage/app/blog"));
$display = Array ( 'md' );
foreach(new RecursiveIteratorIterator($it) as $file)
{
Expand Down
2 changes: 1 addition & 1 deletion database/seeds/PagesTableSeeder.php
Expand Up @@ -14,7 +14,7 @@ public function run()
// update tables instead of overwriting (think timestamps, original...)

$parser = new DocumentParser;
$it = new RecursiveDirectoryIterator(realpath("./storage/app/pages"));
$it = new RecursiveDirectoryIterator(realpath(dirname(dirname(dirname(__FILE__)))."/storage/app/pages"));
$display = Array ( 'md' );
foreach(new RecursiveIteratorIterator($it) as $file)
{
Expand Down
2 changes: 1 addition & 1 deletion database/seeds/ProjectsTableSeeder.php
Expand Up @@ -14,7 +14,7 @@ public function run()
// update tables instead of overwriting (think timestamps, original...)

$parser = new DocumentParser;
$it = new RecursiveDirectoryIterator(realpath("./storage/app/projects"));
$it = new RecursiveDirectoryIterator(realpath(dirname(dirname(dirname(__FILE__)))."/storage/app/projects"));
$display = Array ( 'md' );
foreach(new RecursiveIteratorIterator($it) as $file)
{
Expand Down
10 changes: 8 additions & 2 deletions scripts/setupB3.sh
Expand Up @@ -168,6 +168,12 @@ transparent: false | true
Testings
EOM

# Install composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

# Populate DB
bash $DIR/populate-db.sh

Expand All @@ -176,7 +182,7 @@ cat ~/.ssh/id_rsa.pub | ssh $1 'cat >> .ssh/authorized_keys'

# Set up git hooks and scripts on server and client
HOOK="#!/bin/sh
git --work-tree=$WEBROOT --git-dir=$SERVERROOT/repo/site.git checkout -f
git --work-tree=$WEBROOT --git-dir=$SERVERROOT/repo/site.git checkout -f master
bash $WEBROOT/scripts/populate-db.sh"
ssh $1 "mkdir repo && cd repo && mkdir site.git && cd site.git && git init --bare && cd hooks && echo '$HOOK' > post-receive && chmod +x post-receive"

Expand All @@ -188,7 +194,7 @@ RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC]
RewriteRule ^ %1 [L,NE,R=302]
RewriteRule ^((?!public/).*)$ public/$1 [L,NC]"

ssh $1 "echo '$ACCESS' > $SERVERROOT/.htaccess"
ssh $1 "echo '$ACCESS' > $WEBROOT/.htaccess"

# Add first commit
git add -A && git commit -m "Set up repo"
Expand Down

0 comments on commit 44f0e93

Please sign in to comment.