Skip to content
Snippets Groups Projects
Commit 1d532719 authored by Sam Gleske's avatar Sam Gleske
Browse files

Merge branch 'development' release v0.4.6

parents b373b05b cfea3315
No related branches found
No related tags found
No related merge requests found
## v0.4.6
* Fix bug where all scripts break without a meaningful message if config.sh is not present.
--
## v0.4.5
* Updated docs for Mercurial mirror management.
......
......@@ -10,9 +10,13 @@ set -e
#Include all user options and dependencies
git_mirrors_dir="${0%/*}"
. "${git_mirrors_dir}/config.sh"
[ -f "${git_mirrors_dir}/config.sh" ] && . "${git_mirrors_dir}/config.sh"
. "${git_mirrors_dir}/lib/VERSION"
. "${git_mirrors_dir}/lib/functions.sh"
if [ ! -f "${git_mirrors_dir}/config.sh" ];then
red_echo "config.sh missing! Copy and customize from config.sh.SAMPLE. Aborting." 1>&2
exit 1
fi
#export env vars for python script
export gitlab_user_token_secret gitlab_url gitlab_namespace gitlab_user ssl_verify
......@@ -315,7 +319,7 @@ function preflight() {
#
#Run a preflight check on options for compatibility.
if ! preflight;then
if ! preflight 1>&2;then
echo "Command aborted due to previous errors." 1>&2
exit 1
fi
......
......@@ -8,9 +8,13 @@ set -e
#Include all user options and dependencies
git_mirrors_dir="${0%/*}"
. "${git_mirrors_dir}/config.sh"
[ -f "${git_mirrors_dir}/config.sh" ] && . "${git_mirrors_dir}/config.sh"
. "${git_mirrors_dir}/lib/VERSION"
. "${git_mirrors_dir}/lib/functions.sh"
if [ ! -f "${git_mirrors_dir}/config.sh" ];then
red_echo "config.sh missing! Copy and customize from config.sh.SAMPLE. Aborting." 1>&2
exit 1
fi
#export env vars for python script
export gitlab_user_token_secret gitlab_url gitlab_namespace gitlab_user ssl_verify
......@@ -98,16 +102,16 @@ done
function preflight() {
STATUS=0
if [ -z "${project_name}" ];then
red_echo -n "Must specify " 1>&2
yellow_echo -n "--delete" 1>&2
red_echo -n " or " 1>&2
yellow_echo -n "--no-delete" 1>&2
red_echo " option." 1>&2
red_echo -n "Must specify "
yellow_echo -n "--delete"
red_echo -n " or "
yellow_echo -n "--no-delete"
red_echo " option."
STATUS=1
elif [ ! -e "${repo_dir}/${gitlab_namespace}/${project_name}" ];then
yellow_echo -n "${repo_dir}/${gitlab_namespace}/${project_name}" 1>&2
echo " does not exist." 1>&2
exit
echo " does not exist."
STATUS=1
fi
return ${STATUS}
}
......@@ -117,7 +121,7 @@ function preflight() {
#
#Run a preflight check on options for compatibility.
if ! preflight;then
if ! preflight 1>&2;then
echo "Command aborted due to previous errors." 1>&2
exit 1
fi
......
......@@ -44,7 +44,6 @@ Here's an example of a file tree where I have multiple groups specified with a d
```
/home/gitmirror/
├── ellucian
├── mirror-management
│ ├── GitLab
│ │ └── gitlab-mirrors
......
......@@ -5,9 +5,13 @@
#Include all user options and dependencies
git_mirrors_dir="${0%/*}"
. "${git_mirrors_dir}/config.sh"
[ -f "${git_mirrors_dir}/config.sh" ] && . "${git_mirrors_dir}/config.sh"
. "${git_mirrors_dir}/lib/VERSION"
. "${git_mirrors_dir}/lib/functions.sh"
if [ ! -f "${git_mirrors_dir}/config.sh" ];then
red_echo "config.sh missing! Copy and customize from config.sh.SAMPLE. Aborting." 1>&2
exit 1
fi
cd "${git_mirrors_dir}"
......
VERSION="v0.4.5"
VERSION="v0.4.6"
......@@ -36,6 +36,8 @@ SETSTYLE_BOLD="echo -en \\033[1m"
SETSTYLE_UNDERLINE="echo -en \\033[4m"
SETSTYLE_NORMAL="echo -en \\033[0m"
enable_colors="${enable_colors:-true}"
#same as echo function except the whole text line is red
function red_echo() {
#in order for the -n functionality to work properly $2 must be quoted when called in case of spaces
......
......@@ -10,9 +10,13 @@ set -e
#Include all user options and dependencies
git_mirrors_dir="${0%/*}"
. "${git_mirrors_dir}/config.sh"
[ -f "${git_mirrors_dir}/config.sh" ] && . "${git_mirrors_dir}/config.sh"
. "${git_mirrors_dir}/lib/VERSION"
. "${git_mirrors_dir}/lib/functions.sh"
if [ ! -f "${git_mirrors_dir}/config.sh" ];then
red_echo "config.sh missing! Copy and customize from config.sh.SAMPLE. Aborting." 1>&2
exit 1
fi
PROGNAME="${0##*/}"
PROGVERSION="${VERSION}"
......
......@@ -10,9 +10,13 @@ set -e
#Include all user options and dependencies
git_mirrors_dir="${0%/*}"
. "${git_mirrors_dir}/config.sh"
[ -f "${git_mirrors_dir}/config.sh" ] && . "${git_mirrors_dir}/config.sh"
. "${git_mirrors_dir}/lib/VERSION"
. "${git_mirrors_dir}/lib/functions.sh"
if [ ! -f "${git_mirrors_dir}/config.sh" ];then
red_echo "config.sh missing! Copy and customize from config.sh.SAMPLE. Aborting." 1>&2
exit 1
fi
cd "${git_mirrors_dir}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment