Submodules support
This commit is contained in:
1 parent
419efc2cf1
commit
7f0591fa1e
3 files changed
+19
-1
No files matched your search
@@ -8,6 +8,7 @@ Felipe Coury <felipe.coury@gmail.com>
|
|||||||
Jeff Lindsay <progrium@gmail.com>
|
Jeff Lindsay <progrium@gmail.com>
|
||||||
Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
||||||
Leo Unbekandt <leo@unbekandt.eu>
|
Leo Unbekandt <leo@unbekandt.eu>
|
||||||
|
Ludovic Perrine <jazzzz@gmail.com>
|
||||||
Luigi Maselli <grigio.org@gmail.com>
|
Luigi Maselli <grigio.org@gmail.com>
|
||||||
Martin Weiss <kornnflake@gmail.com>
|
Martin Weiss <kornnflake@gmail.com>
|
||||||
Paul Lietar <paul@lietar.net>
|
Paul Lietar <paul@lietar.net>
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## 0.3.0 (in progress)
|
## 0.3.0 (in progress)
|
||||||
|
|
||||||
|
* Added git submodules support
|
||||||
|
|
||||||
## 0.2.0 (2013-11-24)
|
## 0.2.0 (2013-11-24)
|
||||||
|
|
||||||
* Added DOKKU_TRACE variable for verbose trace information
|
* Added DOKKU_TRACE variable for verbose trace information
|
||||||
|
|||||||
+16
-1
@@ -1,6 +1,21 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
git_archive_all() {
|
||||||
|
APP=$1; REV=$2
|
||||||
|
TMP_WORK_DIR=$(mktemp -d)
|
||||||
|
chmod 755 $TMP_WORK_DIR
|
||||||
|
unset GIT_DIR GIT_WORK_TREE
|
||||||
|
git clone $DOKKU_ROOT/$APP $TMP_WORK_DIR > /dev/null
|
||||||
|
pushd $TMP_WORK_DIR > /dev/null
|
||||||
|
git checkout $REV > /dev/null
|
||||||
|
git submodule update --init --recursive > /dev/null
|
||||||
|
find -name .git -prune -exec rm -rf {} \; > /dev/null
|
||||||
|
tar c .
|
||||||
|
popd > /dev/null
|
||||||
|
rm -rf $TMP_WORK_DIR > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
git-hook)
|
git-hook)
|
||||||
APP=$2
|
APP=$2
|
||||||
@@ -10,7 +25,7 @@ case "$1" in
|
|||||||
# Only run this script for the master branch. You can remove this
|
# 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 block if you wish to run it for others as well.
|
||||||
if [[ $refname = "refs/heads/master" ]] ; then
|
if [[ $refname = "refs/heads/master" ]] ; then
|
||||||
git archive $newrev | dokku receive $APP | sed -u "s/^/"$'\e[1G'"/"
|
git_archive_all $APP $newrev | dokku receive $APP | sed -u "s/^/"$'\e[1G'"/"
|
||||||
else
|
else
|
||||||
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to master."
|
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to master."
|
||||||
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\/}:master'"
|
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\/}:master'"
|
||||||
|
|||||||
Reference in new issue
Block a user