Loading hook-scripts/post-receive/auto-build +4 −12 Original line number Diff line number Diff line Loading @@ -158,6 +158,7 @@ build () { export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" local ref=`_normalise_ref "$1"` local commit="$2" local confsec=`_get_config_section "$ref"` local dbuild=`config location || echo /tmp/build/` local dmax=`config max-builds || echo 4` Loading Loading @@ -204,22 +205,13 @@ build () # create the git repository if it does not exist is_git_workspace "$dir" || git clone "$GIT_DIR" "$dir" >&2 git push "$dir" "$commit":refs/"$ref" # switch to build dir, clean it out & get the correct commit cd "$dir" ( unset GIT_DIR remote_ref="${ref/heads/remotes/origin}" git fetch origin git fetch origin --tags case "${ref%%/*}" in heads) git checkout -B "${ref/heads\//}" "$remote_ref" ;; *) git checkout -B build/ref/"$ref" "$remote_ref" ;; esac git checkout "$commit" git clean -f -d -q -x git reset --hard ) Loading Loading @@ -285,7 +277,7 @@ main () mkdir -p "$log_dir" [ -e "$log_current" ] && rm "$log_current" || true ln -s `basename "$log"` "$log_current" build "$ref" </dev/null &>>"$log" & build "$ref" "$new" </dev/null &>>"$log" & fi done } Loading Loading
hook-scripts/post-receive/auto-build +4 −12 Original line number Diff line number Diff line Loading @@ -158,6 +158,7 @@ build () { export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" local ref=`_normalise_ref "$1"` local commit="$2" local confsec=`_get_config_section "$ref"` local dbuild=`config location || echo /tmp/build/` local dmax=`config max-builds || echo 4` Loading Loading @@ -204,22 +205,13 @@ build () # create the git repository if it does not exist is_git_workspace "$dir" || git clone "$GIT_DIR" "$dir" >&2 git push "$dir" "$commit":refs/"$ref" # switch to build dir, clean it out & get the correct commit cd "$dir" ( unset GIT_DIR remote_ref="${ref/heads/remotes/origin}" git fetch origin git fetch origin --tags case "${ref%%/*}" in heads) git checkout -B "${ref/heads\//}" "$remote_ref" ;; *) git checkout -B build/ref/"$ref" "$remote_ref" ;; esac git checkout "$commit" git clean -f -d -q -x git reset --hard ) Loading Loading @@ -285,7 +277,7 @@ main () mkdir -p "$log_dir" [ -e "$log_current" ] && rm "$log_current" || true ln -s `basename "$log"` "$log_current" build "$ref" </dev/null &>>"$log" & build "$ref" "$new" </dev/null &>>"$log" & fi done } Loading