Skip to content

Commit

Permalink
git deploying
Browse files Browse the repository at this point in the history
  • Loading branch information
carduz committed Nov 14, 2015
1 parent 9b09f0b commit 2a89e68
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ crashlytics-build.properties




### Composer ###
composer.phar
composer.lock
Expand All @@ -114,11 +113,7 @@ composer.lock
coverage.xml


### gulp ###
node_modules/
npm-debug.log
public/css
### DEPLOYING ###
.git_utility


### laravel ide helper ###
.phpstorm.meta.php
_ide_helper.php
15 changes: 15 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

##GIT START

<Files "git.sh">
Order Allow,Deny
deny from all
</Files>

<Files ".gitignore">
Order Allow,Deny
deny from all
</Files>

##GIT END

29 changes: 29 additions & 0 deletions git.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# The MIT License (MIT)
# Copyright (c) 2013 Alvin Abad

if [ $# -eq 0 ]; then
echo "Git wrapper script that can specify an ssh-key file
Usage:
git.sh -i ssh-key-file git-command
"
exit 1
fi

# remove temporary file on exit
trap 'rm -f /tmp/.git_ssh.$$' 0

if [ "$1" = "-i" ]; then
SSH_KEY=$2; shift; shift
echo "ssh -i $SSH_KEY \$@" > /tmp/.git_ssh.$$
chmod +x /tmp/.git_ssh.$$
export GIT_SSH=/tmp/.git_ssh.$$
fi

# in case the git command is repeated
[ "$1" = "git" ] && shift

# Run the git command
git "$@"

3 changes: 3 additions & 0 deletions git_receiver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
system("./git.sh -i .git_utility/key.key git pull origin master");
?>

0 comments on commit 2a89e68

Please sign in to comment.