about summary refs log tree commit diff stats
path: root/tools/conf/srv/gitolite
diff options
context:
space:
mode:
authorpunk <punk@libernaut>2021-04-24 19:35:03 +0100
committerpunk <punk@libernaut>2021-04-24 19:35:03 +0100
commitf832e249164ff5803e8364efbe91ab190be0e6a1 (patch)
tree9416f736afe9321e21df0f5c4c9068c82053c517 /tools/conf/srv/gitolite
parent27ecf5c9efad163fee94619ab67f05f5f381831e (diff)
downloaddoc-f832e249164ff5803e8364efbe91ab190be0e6a1.tar.gz
tools/gitolite hooks transition from bash to sh
Diffstat (limited to 'tools/conf/srv/gitolite')
-rwxr-xr-xtools/conf/srv/gitolite/deploy-web (renamed from tools/conf/srv/gitolite/deploy-web-doc)17
-rw-r--r--tools/conf/srv/gitolite/deploy-web.sh6
-rw-r--r--tools/conf/srv/gitolite/hook.sh12
3 files changed, 19 insertions, 16 deletions
diff --git a/tools/conf/srv/gitolite/deploy-web-doc b/tools/conf/srv/gitolite/deploy-web
index b836515..aa4a7fa 100755
--- a/tools/conf/srv/gitolite/deploy-web-doc
+++ b/tools/conf/srv/gitolite/deploy-web
@@ -1,28 +1,31 @@
-#!/bin/bash
+#!/bin/sh
+
 ######################################################################
 #
 # Put this file in your gitolite-admin;
-# ~/gitolite-admin/local/hooks/repo-specific/hook-deploy-web
+# ~/gitolite-admin/local/hooks/repo-specific/deploy-web
 #
 # set host to empty to create package for each push
 # or set remote host to create package based on last deployed push
 # host="https://doc.localhost"
 host=""
 # set name of witch branch should be deployed
-branch_to_deploy="deploy_branch"
+branch_to_deploy="master"
 
 ######################################################################
 
 
 url="$host/.last_deploy"
-source /srv/gitolite/deploy/hook.sh
+
+. /srv/gitolite/deploy/hook.sh
+
 read oldrev newrev refname
 push_branch=$(git rev-parse --symbolic --abbrev-ref $refname)
 
-#SCRIPT_VARS=$(set)
+SCRIPT_VARS=$(set)
 #echo "project: $PROJECT"
-#echo "local dir: $PWD" &gt; /srv/gitolite/deploy/${GL_REPO}
-#echo "${SCRIPT_VARS}" &gt;&gt; /srv/gitolite/deploy/${GL_REPO}
+#echo "local dir: $PWD : /srv/gitolite/deploy/${GL_REPO}"
+#echo "${SCRIPT_VARS} : /srv/gitolite/deploy/${GL_REPO}"
 
 if [[ $push_branch = $branch_to_deploy  ]]; then
 
diff --git a/tools/conf/srv/gitolite/deploy-web.sh b/tools/conf/srv/gitolite/deploy-web.sh
index 86d2026..702f110 100644
--- a/tools/conf/srv/gitolite/deploy-web.sh
+++ b/tools/conf/srv/gitolite/deploy-web.sh
@@ -1,9 +1,9 @@
-#!/bin/bash
+#!/bin/sh
 
 pkg_path=$1
 
-www_root="/srv/www"
-www_user="www"
+www_root="/srv/www/htdocs"
+www_user="daemon"
 www_group="www"
 
 pkg_file="${pkg_path}/project"
diff --git a/tools/conf/srv/gitolite/hook.sh b/tools/conf/srv/gitolite/hook.sh
index 1f977ca..7a98a8c 100644
--- a/tools/conf/srv/gitolite/hook.sh
+++ b/tools/conf/srv/gitolite/hook.sh
@@ -1,11 +1,11 @@
-#!/bin/bash
+#!/bin/sh
 
 # final packages dir
 packages_dir="/srv/gitolite/deploy/packages"
 # hook work directory
 hook_dir="/srv/gitolite/deploy/hook_dir"
 
-function is_initial(){
+is_initial(){
     local prj_name=$1
     if [ ! -d ${hook_dir}/${prj_name} ]; then
         echo "true"
@@ -14,18 +14,18 @@ function is_initial(){
     fi
 }
 
-function get_remote_rev(){
+get_remote_rev(){
     echo $(wget --no-check-certificate -qO- $1)
 }
 
-function valid_url(){
-    if [[ `wget -S --spider $1 --no-check-certificate 2>&1 | grep 'HTTP/1.1 200 OK'` ]];
+valid_url(){
+    if [[ `wget -S --spider $1 --no-check-certificate 2>&1 | grep -c 'HTTP/1.1 200 OK'` -eq 1 ]];
     then
         echo "true";
     fi
 }
 
-function create_package(){
+create_package(){
     # project name
     local prj_name=$1
     # git repository directory