Merge pull request #370 from jazzzz/submodules

Submodule support
This commit is contained in:
rhy-jot
2013-12-28 19:50:23 -08:00
7 changed files with 35 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ Felipe Coury <felipe.coury@gmail.com>
Jeff Lindsay <progrium@gmail.com>
Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
Leo Unbekandt <leo@unbekandt.eu>
Ludovic Perrine <jazzzz@gmail.com>
Luigi Maselli <grigio.org@gmail.com>
Martin Weiss <kornnflake@gmail.com>
Paul Lietar <paul@lietar.net>

View File

@@ -2,6 +2,8 @@
## 0.3.0 (in progress)
* Added git submodules support
## 0.2.0 (2013-11-24)
* Added DOKKU_TRACE variable for verbose trace information

View File

@@ -1,6 +1,21 @@
#!/usr/bin/env bash
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
git-hook)
APP=$2
@@ -10,7 +25,7 @@ case "$1" in
# 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 | sed -u "s/^/"$'\e[1G'"/"
git_archive_all $APP $newrev | dokku receive $APP | sed -u "s/^/"$'\e[1G'"/"
else
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'"

View File

@@ -0,0 +1 @@
web: bin/node node-js-sample/web.js

View File

@@ -0,0 +1,2 @@
#!/bin/bash
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "Hello World!"

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"
}
}

View File

@@ -0,0 +1,2 @@
#!/bin/bash
git submodule add https://github.com/heroku/node-js-sample.git node-js-sample