Skip to content

Commit 7f0591f

Browse files
committed
Submodules support
1 parent 419efc2 commit 7f0591f

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎AUTHORS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Felipe Coury <felipe.coury@gmail.com>
88
Jeff Lindsay <progrium@gmail.com>
99
Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
1010
Leo Unbekandt <leo@unbekandt.eu>
11+
Ludovic Perrine <jazzzz@gmail.com>
1112
Luigi Maselli <grigio.org@gmail.com>
1213
Martin Weiss <kornnflake@gmail.com>
1314
Paul Lietar <paul@lietar.net>

‎HISTORY.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## 0.3.0 (in progress)
44

5+
* Added git submodules support
6+
57
## 0.2.0 (2013-11-24)
68

79
* Added DOKKU_TRACE variable for verbose trace information

‎plugins/git/commands‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
#!/usr/bin/env bash
22
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
33

4+
git_archive_all() {
5+
APP=$1; REV=$2
6+
TMP_WORK_DIR=$(mktemp -d)
7+
chmod 755 $TMP_WORK_DIR
8+
unset GIT_DIR GIT_WORK_TREE
9+
git clone $DOKKU_ROOT/$APP $TMP_WORK_DIR > /dev/null
10+
pushd $TMP_WORK_DIR > /dev/null
11+
git checkout $REV > /dev/null
12+
git submodule update --init --recursive > /dev/null
13+
find -name .git -prune -exec rm -rf {} \; > /dev/null
14+
tar c .
15+
popd > /dev/null
16+
rm -rf $TMP_WORK_DIR > /dev/null
17+
}
18+
419
case "$1" in
520
git-hook)
621
APP=$2
@@ -10,7 +25,7 @@ case "$1" in
1025
# Only run this script for the master branch. You can remove this
1126
# if block if you wish to run it for others as well.
1227
if [[ $refname = "refs/heads/master" ]] ; then
13-
git archive $newrev | dokku receive $APP | sed -u "s/^/"$'\e[1G'"/"
28+
git_archive_all $APP $newrev | dokku receive $APP | sed -u "s/^/"$'\e[1G'"/"
1429
else
1530
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to master."
1631
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\/}:master'"

0 commit comments

Comments
 (0)