diff --git a/conf/errors.conf.sample b/conf/errors.conf.sample index 6c8a106..84541cb 100644 --- a/conf/errors.conf.sample +++ b/conf/errors.conf.sample @@ -30,6 +30,9 @@ err_git_runner_groupname_empty=38 err_git_runner_group_not_exist=39 err_runner_deployer_groupname_empty=40 err_runner_deployer_group_not_exist=41 +err_pipeline_sock_dir_empty=42 +err_pipeline_sock_dir_not_directory=43 +err_pipeline_sock_dir_not_writable=44 # JSON parsing errors err_json_bad_format=51 diff --git a/src/pipeline.sh b/src/pipeline.sh index 52a1c97..5fdb303 100755 --- a/src/pipeline.sh +++ b/src/pipeline.sh @@ -171,6 +171,18 @@ main() ( "${err_git_runner_group_not_exist}" fi + if [ -z "${pipeline_sock_dir}" ]; then + fail "Variable pipeline_sock_dir is empty." "${err_pipeline_sock_dir_empty}" + fi + if [ ! -d "${pipeline_sock_dir}" ]; then + fail "Directory pipeline_sock_dir='${pipeline_sock_dir}' does not exist." \ + "${err_pipeline_sock_dir_not_directory}" + fi + if [ ! -w "${pipeline_sock_dir}" ]; then + fail "Directory pipeline_sock_dir='${pipeline_sock_dir}' is not writable." \ + "${err_pipeline_sock_dir_not_writable}" + fi + # Generate pipeline tmp sock. tsp="$(date +%s)" random="$(echo "${RANDOM}" | md5sum | head --bytes 32)"