about summary refs log tree commit diff stats
path: root/tools/conf/srv/gitolite/hook.sh
diff options
context:
space:
mode:
authorpunk <punk@libernaut>2021-04-29 16:11:04 +0100
committerpunk <punk@libernaut>2021-04-29 16:11:25 +0100
commit9bef2e2b7ea351b6b1cb490597356677db61ff34 (patch)
treec36ae24aa3c36f6c19284c7d4da7c25a620bfabf /tools/conf/srv/gitolite/hook.sh
parent6b5cf63d1987889e272643bf7eeb7725df856d11 (diff)
parent5e601f7ee14830ef645ee3d3b1bcdce7450a5ce3 (diff)
downloaddoc-9bef2e2b7ea351b6b1cb490597356677db61ff34.tar.gz
release 0.7.2 HEAD master
Diffstat (limited to 'tools/conf/srv/gitolite/hook.sh')
-rw-r--r--tools/conf/srv/gitolite/hook.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/conf/srv/gitolite/hook.sh b/tools/conf/srv/gitolite/hook.sh
index 1f977ca..be6a696 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
@@ -87,7 +87,7 @@ function create_package(){
 
     fi
 
-    tar -zcpf ${pkg_tar} --directory=${pkg_dir} .
+    tar -zcpf ${pkg_tar} -C ${pkg_dir} .
 
     echo "Deploy: package ${pkg_tar} ready !"
     rm -r ${pkg_dir}