-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This removes the need for two distinct users. Git pushes and dokku commands are sent using the same user.
- Loading branch information
Showing
11 changed files
with
64 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
set -e; | ||
|
||
case "$1" in | ||
git-hook) | ||
APP=$2 | ||
|
||
while read oldrev newrev refname | ||
do | ||
# Only run this script for the master branch. You can remove this | ||
# if block if you wish to run it for others as well. | ||
if [[ $refname = "refs/heads/master" ]] ; then | ||
git archive $newrev | dokku receive $APP | ||
fi | ||
|
||
done | ||
;; | ||
|
||
git-*) | ||
APP="$(echo $2 | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g')" | ||
APP_PATH=$HOME/$APP | ||
|
||
if [[ $1 == "git-receive-pack" && ! -d $APP_PATH ]]; then | ||
git init --bare $APP_PATH > /dev/null | ||
PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive" | ||
cat > $PRERECEIVE_HOOK <<EOF | ||
#!/bin/bash | ||
cat | dokku git-hook $APP | ||
EOF | ||
chmod +x $PRERECEIVE_HOOK | ||
fi | ||
|
||
args=$@ | ||
git-shell -c "$args" | ||
;; | ||
|
||
esac | ||
cat | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ cd "$(dirname $SELF)/.." && vagrant up | indent | |
cd "$(dirname $SELF)" | ||
|
||
echo "-----> Installing SSH public keys..." | ||
cat $PUBLIC_KEY | ssh -o "StrictHostKeyChecking=no" -i ~/.vagrant.d/insecure_private_key [email protected] "sudo gitreceive upload-key test" | ||
cat $PUBLIC_KEY | ssh -o "StrictHostKeyChecking=no" -i ~/.vagrant.d/insecure_private_key [email protected] "sudo sshcommand acl-add dokku test" | ||
|
||
for app_path in apps/*; do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters