File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 1616
1717init_remote () {
1818 # Create remote repository
19- ssh " ${SERVER} " << DOC
19+ ssh " ${SERVER} " /bin/bash << DOC
2020if [[ ! -d ~/${REPO_PATH} ]]; then
2121 mkdir -p ~/${REPO_PATH}
2222 cd ~/${REPO_PATH}
3131 ssh " ${SERVER} " " cat > ~/${HOOK} " << DOC
3232#!/bin/sh
3333while read old new refname; do
34- build_dir=.build/\$ {new}
35- mkdir -p \$ {build_dir}
36- git archive \$ {new} | tar -x -C \$ {build_dir}
37- cd \$ {build_dir}
38- make git-deploy || exit 1
34+ case "\$ refname" in
35+ refs/heads/*)
36+ echo "Deploying ref \$ refname"
37+ build_dir=.build/\$ {new}
38+ mkdir -p \$ {build_dir}
39+ git archive \$ {new} | tar -x -C \$ {build_dir}
40+ cd \$ {build_dir}
41+ make git-deploy || exit 1
42+ ;;
43+ refs/tags/*)
44+ echo "Skipping non-commit tag ref \$ refname"
45+ ;;
46+ *)
47+ echo "Skipping unknown ref type \$ refname"
48+ ;;
49+ esac
3950done
4051DOC
4152
6778echo " Pushing to ${SERVER} "
6879git push " ${SERVER} " master && post_deploy
6980
70- exit 0
81+ exit 0
You can’t perform that action at this time.
0 commit comments