Merge pull request #370 from jazzzz/submodules

Submodule support
This commit is contained in:
rhy-jot committed 2013-12-28 19:50:23 -08:00
commit f0c41e3a81
7 files changed
+35 -1

No files matched your search

+1
View File
@@ -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
View File
@@ -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
View File
@@ -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'"
+1
View File
@@ -0,0 +1 @@
web: bin/node node-js-sample/web.js
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "Hello World!"
+11
View File
@@ -0,0 +1,11 @@
{
"name": "node-example",
"version": "0.0.1",
"dependencies": {
"express": "~3.3.4"
},
"engines": {
"node": "0.10.x",
"npm": "1.3.x"
}
}
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
git submodule add https://github.com/heroku/node-js-sample.git node-js-sample