Merge branch 'rename_chili_to_redmine'
This commit is contained in:
commit
4e9f85f9e1
|
@ -1,4 +0,0 @@
|
||||||
DOC_PATH=/var/doc/chiliproject
|
|
||||||
TMP_PATH=/tmp/chiliproject-doxygen$RANDOM$RANDOM
|
|
||||||
MYSQL_USER=chiliproject
|
|
||||||
MYSQL_DBNAME=chiliproject
|
|
|
@ -2,6 +2,6 @@ export LANG=ru_RU.UTF-8
|
||||||
MYSQL_USER=git
|
MYSQL_USER=git
|
||||||
MYSQL_HOSTNAME=127.0.0.1
|
MYSQL_HOSTNAME=127.0.0.1
|
||||||
GITORIOUS_MYSQL_DBNAME=gitorious
|
GITORIOUS_MYSQL_DBNAME=gitorious
|
||||||
CHILI_MYSQL_DBNAME=chiliproject
|
REDMINE_MYSQL_DBNAME=redmine
|
||||||
GITORIOUS_REPOS_PATH=/var/www/gitorious/repositories
|
GITORIOUS_REPOS_PATH=/var/www/gitorious/repositories
|
||||||
CHILI_REQUIRED_ROLES="Ответственный Менеджер Major Manager Responsible"
|
REDMINE_REQUIRED_ROLES="Ответственный Менеджер Major Manager Responsible"
|
|
@ -0,0 +1,4 @@
|
||||||
|
DOC_PATH=/var/doc/redmine
|
||||||
|
TMP_PATH=/tmp/redmine-doxygen$RANDOM$RANDOM
|
||||||
|
MYSQL_USER=redmine
|
||||||
|
MYSQL_DBNAME=redmine
|
|
@ -1,6 +0,0 @@
|
||||||
export LANG=ru_RU.UTF-8
|
|
||||||
RHODECODE_SQLITE_PATH=/home/rhodecode/rhodecode/rhodecode.db
|
|
||||||
CHILI_MYSQL_USER=redmine
|
|
||||||
CHILI_MYSQL_DBNAME=redmine
|
|
||||||
CHILI_MYSQL_HOSTNAME=127.0.0.1
|
|
||||||
CHILI_REQUIRED_ROLES="Ответственный Менеджер Major Manager Responsible"
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
export LANG=ru_RU.UTF-8
|
||||||
|
RHODECODE_SQLITE_PATH=/home/rhodecode/rhodecode/rhodecode.db
|
||||||
|
REDMINE_MYSQL_USER=redmine
|
||||||
|
REDMINE_MYSQL_DBNAME=redmine
|
||||||
|
REDMINE_MYSQL_HOSTNAME=127.0.0.1
|
||||||
|
REDMINE_REQUIRED_ROLES="Ответственный Менеджер Major Manager Responsible"
|
|
@ -1,18 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# load config files
|
# load config files
|
||||||
if [ -f /etc/gitorious_chiliproject ]; then
|
if [ -f /etc/gitorious_redmine ]; then
|
||||||
source /etc/gitorious_chiliproject
|
source /etc/gitorious_redmine
|
||||||
elif [ -f ~/etc/gitorious_chiliproject ]; then
|
elif [ -f ~/etc/gitorious_redmine ]; then
|
||||||
source ~/etc/gitorious_chiliproject
|
source ~/etc/gitorious_redmine
|
||||||
else
|
else
|
||||||
echo "Config file not found ;-("
|
echo "Config file not found ;-("
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# === REMOVE ALL BROKEN REPOSITORY LINKS IN CHILIPROJECT MYSQL DATABASE ===
|
# === REMOVE ALL BROKEN REPOSITORY LINKS IN REDMINE MYSQL DATABASE ===
|
||||||
ALL_MYSQL_REPOS=`mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "SELECT url,root_url,id
|
ALL_MYSQL_REPOS=`mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "SELECT url,root_url,id
|
||||||
FROM $CHILI_MYSQL_DBNAME.repositories
|
FROM $REDMINE_MYSQL_DBNAME.repositories
|
||||||
WHERE type='Git'
|
WHERE type='Git'
|
||||||
OR type='Repository::Git'" \
|
OR type='Repository::Git'" \
|
||||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+4`
|
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+4`
|
||||||
|
@ -30,70 +30,70 @@ for v in $ALL_MYSQL_REPOS; do
|
||||||
let n++
|
let n++
|
||||||
done;
|
done;
|
||||||
repos_to_remove=${repos_to_remove#,}
|
repos_to_remove=${repos_to_remove#,}
|
||||||
[ "$repos_to_remove" != "" ] && mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "DELETE FROM $CHILI_MYSQL_DBNAME.repositories WHERE id IN ($repos_to_remove)"
|
[ "$repos_to_remove" != "" ] && mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "DELETE FROM $REDMINE_MYSQL_DBNAME.repositories WHERE id IN ($repos_to_remove)"
|
||||||
|
|
||||||
# === REMOVE REPOSITORY LINKS WITH DIFFERENT PROJECT NAMES ===
|
# === REMOVE REPOSITORY LINKS WITH DIFFERENT PROJECT NAMES ===
|
||||||
REMOVE_IDS=`mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "SELECT $CHILI_MYSQL_DBNAME.repositories.id
|
REMOVE_IDS=`mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "SELECT $REDMINE_MYSQL_DBNAME.repositories.id
|
||||||
FROM $CHILI_MYSQL_DBNAME.projects,
|
FROM $REDMINE_MYSQL_DBNAME.projects,
|
||||||
$CHILI_MYSQL_DBNAME.repositories,
|
$REDMINE_MYSQL_DBNAME.repositories,
|
||||||
$GITORIOUS_MYSQL_DBNAME.repositories
|
$GITORIOUS_MYSQL_DBNAME.repositories
|
||||||
WHERE ($CHILI_MYSQL_DBNAME.repositories.url=CONCAT('$GITORIOUS_REPOS_PATH/',$GITORIOUS_MYSQL_DBNAME.repositories.hashed_path,'.git')
|
WHERE ($REDMINE_MYSQL_DBNAME.repositories.url=CONCAT('$GITORIOUS_REPOS_PATH/',$GITORIOUS_MYSQL_DBNAME.repositories.hashed_path,'.git')
|
||||||
OR $CHILI_MYSQL_DBNAME.repositories.root_url=CONCAT('$GITORIOUS_REPOS_PATH/',$GITORIOUS_MYSQL_DBNAME.repositories.hashed_path,'.git'))
|
OR $REDMINE_MYSQL_DBNAME.repositories.root_url=CONCAT('$GITORIOUS_REPOS_PATH/',$GITORIOUS_MYSQL_DBNAME.repositories.hashed_path,'.git'))
|
||||||
AND $CHILI_MYSQL_DBNAME.projects.name <> $GITORIOUS_MYSQL_DBNAME.repositories.name
|
AND $REDMINE_MYSQL_DBNAME.projects.name <> $GITORIOUS_MYSQL_DBNAME.repositories.name
|
||||||
AND $CHILI_MYSQL_DBNAME.projects.id = $CHILI_MYSQL_DBNAME.repositories.project_id
|
AND $REDMINE_MYSQL_DBNAME.projects.id = $REDMINE_MYSQL_DBNAME.repositories.project_id
|
||||||
;" \
|
;" \
|
||||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||||
[ "$REMOVE_IDS" != "" ] && mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "DELETE FROM $CHILI_MYSQL_DBNAME.repositories WHERE id IN ($REMOVE_IDS)"
|
[ "$REMOVE_IDS" != "" ] && mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "DELETE FROM $REDMINE_MYSQL_DBNAME.repositories WHERE id IN ($REMOVE_IDS)"
|
||||||
|
|
||||||
# === GET DATA FROM GITORIOUS MYSQL BASE ===
|
# === GET DATA FROM GITORIOUS MYSQL BASE ===
|
||||||
roles_mysql_string=`echo $CHILI_REQUIRED_ROLES | sed "s~\>~'~g ; s~\<~,'~g ; s~^,~~ ; s~ ~~g"`
|
roles_mysql_string=`echo $REDMINE_REQUIRED_ROLES | sed "s~\>~'~g ; s~\<~,'~g ; s~^,~~ ; s~ ~~g"`
|
||||||
CHILI_ID_GITORIOUS_REPO=`mysql --default-character-set=utf8 -h$MYSQL_HOSTNAME -u $MYSQL_USER -e \
|
REDMINE_ID_GITORIOUS_REPO=`mysql --default-character-set=utf8 -h$MYSQL_HOSTNAME -u $MYSQL_USER -e \
|
||||||
"SELECT DISTINCT $CHILI_MYSQL_DBNAME.projects.id,$GITORIOUS_MYSQL_DBNAME.repositories.hashed_path
|
"SELECT DISTINCT $REDMINE_MYSQL_DBNAME.projects.id,$GITORIOUS_MYSQL_DBNAME.repositories.hashed_path
|
||||||
FROM $CHILI_MYSQL_DBNAME.member_roles,
|
FROM $REDMINE_MYSQL_DBNAME.member_roles,
|
||||||
$CHILI_MYSQL_DBNAME.members,
|
$REDMINE_MYSQL_DBNAME.members,
|
||||||
$CHILI_MYSQL_DBNAME.projects,
|
$REDMINE_MYSQL_DBNAME.projects,
|
||||||
$CHILI_MYSQL_DBNAME.roles,
|
$REDMINE_MYSQL_DBNAME.roles,
|
||||||
$CHILI_MYSQL_DBNAME.users,
|
$REDMINE_MYSQL_DBNAME.users,
|
||||||
$GITORIOUS_MYSQL_DBNAME.repositories,
|
$GITORIOUS_MYSQL_DBNAME.repositories,
|
||||||
$GITORIOUS_MYSQL_DBNAME.roles,
|
$GITORIOUS_MYSQL_DBNAME.roles,
|
||||||
$GITORIOUS_MYSQL_DBNAME.users
|
$GITORIOUS_MYSQL_DBNAME.users
|
||||||
WHERE $CHILI_MYSQL_DBNAME.member_roles.member_id=$CHILI_MYSQL_DBNAME.members.id
|
WHERE $REDMINE_MYSQL_DBNAME.member_roles.member_id=$REDMINE_MYSQL_DBNAME.members.id
|
||||||
AND $CHILI_MYSQL_DBNAME.member_roles.role_id=$CHILI_MYSQL_DBNAME.roles.id
|
AND $REDMINE_MYSQL_DBNAME.member_roles.role_id=$REDMINE_MYSQL_DBNAME.roles.id
|
||||||
AND $CHILI_MYSQL_DBNAME.members.user_id=$CHILI_MYSQL_DBNAME.users.id
|
AND $REDMINE_MYSQL_DBNAME.members.user_id=$REDMINE_MYSQL_DBNAME.users.id
|
||||||
AND $CHILI_MYSQL_DBNAME.members.project_id=$CHILI_MYSQL_DBNAME.projects.id
|
AND $REDMINE_MYSQL_DBNAME.members.project_id=$REDMINE_MYSQL_DBNAME.projects.id
|
||||||
AND $CHILI_MYSQL_DBNAME.projects.name=$GITORIOUS_MYSQL_DBNAME.repositories.name
|
AND $REDMINE_MYSQL_DBNAME.projects.name=$GITORIOUS_MYSQL_DBNAME.repositories.name
|
||||||
AND $CHILI_MYSQL_DBNAME.users.type='User'
|
AND $REDMINE_MYSQL_DBNAME.users.type='User'
|
||||||
AND $CHILI_MYSQL_DBNAME.users.mail=$GITORIOUS_MYSQL_DBNAME.users.email
|
AND $REDMINE_MYSQL_DBNAME.users.mail=$GITORIOUS_MYSQL_DBNAME.users.email
|
||||||
AND $CHILI_MYSQL_DBNAME.roles.name IN ($roles_mysql_string)
|
AND $REDMINE_MYSQL_DBNAME.roles.name IN ($roles_mysql_string)
|
||||||
AND $GITORIOUS_MYSQL_DBNAME.repositories.user_id=$GITORIOUS_MYSQL_DBNAME.users.id;" \
|
AND $GITORIOUS_MYSQL_DBNAME.repositories.user_id=$GITORIOUS_MYSQL_DBNAME.users.id;" \
|
||||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+3`
|
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+3`
|
||||||
|
|
||||||
# add repositories paths to $CHILI_MYSQL_DBNAME.repositories
|
# add repositories paths to $REDMINE_MYSQL_DBNAME.repositories
|
||||||
chili_project_id=
|
redmine_project_id=
|
||||||
gitorious_path=
|
gitorious_path=
|
||||||
let n=0
|
let n=0
|
||||||
for v in $CHILI_ID_GITORIOUS_REPO; do
|
for v in $REDMINE_ID_GITORIOUS_REPO; do
|
||||||
let idx=n/2
|
let idx=n/2
|
||||||
case $((n%2)) in
|
case $((n%2)) in
|
||||||
0) chili_project_id=$v ;;
|
0) redmine_project_id=$v ;;
|
||||||
1) gitorious_path=$GITORIOUS_REPOS_PATH/$v.git
|
1) gitorious_path=$GITORIOUS_REPOS_PATH/$v.git
|
||||||
# Test for already present repo
|
# Test for already present repo
|
||||||
ALREADY_EXIST=`mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "SELECT id
|
ALREADY_EXIST=`mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "SELECT id
|
||||||
FROM $CHILI_MYSQL_DBNAME.repositories
|
FROM $REDMINE_MYSQL_DBNAME.repositories
|
||||||
WHERE project_id='$chili_project_id'
|
WHERE project_id='$redmine_project_id'
|
||||||
OR url='$gitorious_path'
|
OR url='$gitorious_path'
|
||||||
OR root_url='$gitorious_path'" \
|
OR root_url='$gitorious_path'" \
|
||||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||||
if [ "" == "$ALREADY_EXIST" ]; then
|
if [ "" == "$ALREADY_EXIST" ]; then
|
||||||
# insert to $CHILI_MYSQL_DBNAME.repositories
|
# insert to $REDMINE_MYSQL_DBNAME.repositories
|
||||||
echo "insert $chili_project_id: $gitorious_path"
|
echo "insert $redmine_project_id: $gitorious_path"
|
||||||
mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "INSERT INTO $CHILI_MYSQL_DBNAME.repositories(project_id,
|
mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "INSERT INTO $REDMINE_MYSQL_DBNAME.repositories(project_id,
|
||||||
url,
|
url,
|
||||||
root_url,
|
root_url,
|
||||||
type,
|
type,
|
||||||
path_encoding,
|
path_encoding,
|
||||||
is_default)
|
is_default)
|
||||||
VALUES('$chili_project_id',
|
VALUES('$redmine_project_id',
|
||||||
'$gitorious_path',
|
'$gitorious_path',
|
||||||
'$gitorious_path',
|
'$gitorious_path',
|
||||||
'Repository::Git',
|
'Repository::Git',
|
|
@ -1,10 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# load config files
|
# load config files
|
||||||
if [ -f /etc/chiliproject_doxygen ]; then
|
if [ -f /etc/redmine_doxygen ]; then
|
||||||
source /etc/chiliproject_doxygen
|
source /etc/redmine_doxygen
|
||||||
elif [ -f ~/etc/chiliproject_doxygen ]; then
|
elif [ -f ~/etc/redmine_doxygen ]; then
|
||||||
source ~/etc/chiliproject_doxygen
|
source ~/etc/redmine_doxygen
|
||||||
else
|
else
|
||||||
echo "Config file not found ;-("
|
echo "Config file not found ;-("
|
||||||
exit -1
|
exit -1
|
|
@ -1,18 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# load config files
|
# load config files
|
||||||
if [ -f /etc/rhodecode_chiliproject ]; then
|
if [ -f /etc/rhodecode_redmine ]; then
|
||||||
source /etc/rhodecode_chiliproject
|
source /etc/rhodecode_redmine
|
||||||
elif [ -f ~/etc/rhodecode_chiliproject ]; then
|
elif [ -f ~/etc/rhodecode_redmine ]; then
|
||||||
source ~/etc/rhodecode_chiliproject
|
source ~/etc/rhodecode_redmine
|
||||||
else
|
else
|
||||||
echo "Config file not found ;-("
|
echo "Config file not found ;-("
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# === REMOVE ALL BROKEN REPOSITORY LINKS IN CHILIPROJECT MYSQL DATABASE ===
|
# === REMOVE ALL BROKEN REPOSITORY LINKS IN REDMINE MYSQL DATABASE ===
|
||||||
ALL_MYSQL_REPOS=`mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT url,root_url,id
|
ALL_MYSQL_REPOS=`mysql -h$REDMINE_MYSQL_HOSTNAME -u $REDMINE_MYSQL_USER -e "SELECT url,root_url,id
|
||||||
FROM $CHILI_MYSQL_DBNAME.repositories
|
FROM $REDMINE_MYSQL_DBNAME.repositories
|
||||||
WHERE type='Mercurial'
|
WHERE type='Mercurial'
|
||||||
OR type='Repository::Mercurial'" \
|
OR type='Repository::Mercurial'" \
|
||||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+4`
|
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+4`
|
||||||
|
@ -30,8 +30,8 @@ for v in $ALL_MYSQL_REPOS; do
|
||||||
let n++
|
let n++
|
||||||
done;
|
done;
|
||||||
repos_to_remove=${repos_to_remove#,}
|
repos_to_remove=${repos_to_remove#,}
|
||||||
[ "$repos_to_remove" != "" ] && mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "DELETE
|
[ "$repos_to_remove" != "" ] && mysql -h$REDMINE_MYSQL_HOSTNAME -u $REDMINE_MYSQL_USER -e "DELETE
|
||||||
FROM $CHILI_MYSQL_DBNAME.repositories
|
FROM $REDMINE_MYSQL_DBNAME.repositories
|
||||||
WHERE id IN ($repos_to_remove)"
|
WHERE id IN ($repos_to_remove)"
|
||||||
|
|
||||||
# === GET DATA FROM RHODECODE SQLITE BASE ===
|
# === GET DATA FROM RHODECODE SQLITE BASE ===
|
||||||
|
@ -64,46 +64,46 @@ done
|
||||||
|
|
||||||
# === FOR ALL REPOS FROM RHODECODE DATABASE===
|
# === FOR ALL REPOS FROM RHODECODE DATABASE===
|
||||||
for i in `seq 0 $((nrepos-1))`; do
|
for i in `seq 0 $((nrepos-1))`; do
|
||||||
# === GET DATA FROM CHILIPROJECT MYSQL BASE ===
|
# === GET DATA FROM REDMINE MYSQL BASE ===
|
||||||
USERID=`mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT id
|
USERID=`mysql -h$REDMINE_MYSQL_HOSTNAME -u $REDMINE_MYSQL_USER -e "SELECT id
|
||||||
FROM $CHILI_MYSQL_DBNAME.users
|
FROM $REDMINE_MYSQL_DBNAME.users
|
||||||
WHERE users.status='1'
|
WHERE users.status='1'
|
||||||
AND users.mail='${repos_mails[$i]}'
|
AND users.mail='${repos_mails[$i]}'
|
||||||
AND users.type='User'" \
|
AND users.type='User'" \
|
||||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||||
[ "$USERID" == "" ] && continue
|
[ "$USERID" == "" ] && continue
|
||||||
|
|
||||||
PROJECTID=`mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT DISTINCT id FROM $CHILI_MYSQL_DBNAME.projects
|
PROJECTID=`mysql -h$REDMINE_MYSQL_HOSTNAME -u $REDMINE_MYSQL_USER -e "SELECT DISTINCT id FROM $REDMINE_MYSQL_DBNAME.projects
|
||||||
WHERE name='${repos_names[$i]}'
|
WHERE name='${repos_names[$i]}'
|
||||||
AND status='1'" \
|
AND status='1'" \
|
||||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||||
[ "$PROJECTID" == "" ] && continue
|
[ "$PROJECTID" == "" ] && continue
|
||||||
|
|
||||||
REMOVE_ID=`mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT repositories.id
|
REMOVE_ID=`mysql -h$REDMINE_MYSQL_HOSTNAME -u $REDMINE_MYSQL_USER -e "SELECT repositories.id
|
||||||
FROM $CHILI_MYSQL_DBNAME.repositories,$CHILI_MYSQL_DBNAME.projects
|
FROM $REDMINE_MYSQL_DBNAME.repositories,$REDMINE_MYSQL_DBNAME.projects
|
||||||
WHERE (repositories.url='${repos_paths[$i]}'
|
WHERE (repositories.url='${repos_paths[$i]}'
|
||||||
OR repositories.root_url='${repos_paths[$i]}')
|
OR repositories.root_url='${repos_paths[$i]}')
|
||||||
AND repositories.project_id=projects.id
|
AND repositories.project_id=projects.id
|
||||||
AND projects.name <> '${repos_names[$i]}'" \
|
AND projects.name <> '${repos_names[$i]}'" \
|
||||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||||
|
|
||||||
[ "$REMOVE_ID" != "" ] && mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "DELETE
|
[ "$REMOVE_ID" != "" ] && mysql -h$REDMINE_MYSQL_HOSTNAME -u $REDMINE_MYSQL_USER -e "DELETE
|
||||||
FROM $CHILI_MYSQL_DBNAME.repositories
|
FROM $REDMINE_MYSQL_DBNAME.repositories
|
||||||
WHERE id = '$REMOVE_ID'"
|
WHERE id = '$REMOVE_ID'"
|
||||||
|
|
||||||
ALREADY_EXIST=`mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT id
|
ALREADY_EXIST=`mysql -h$REDMINE_MYSQL_HOSTNAME -u $REDMINE_MYSQL_USER -e "SELECT id
|
||||||
FROM $CHILI_MYSQL_DBNAME.repositories
|
FROM $REDMINE_MYSQL_DBNAME.repositories
|
||||||
WHERE project_id='$PROJECTID'
|
WHERE project_id='$PROJECTID'
|
||||||
OR url='${repos_paths[$i]}'
|
OR url='${repos_paths[$i]}'
|
||||||
OR root_url='${repos_paths[$i]}'" \
|
OR root_url='${repos_paths[$i]}'" \
|
||||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||||
[ "$ALREADY_EXIST" != "" ] && continue
|
[ "$ALREADY_EXIST" != "" ] && continue
|
||||||
|
|
||||||
roles_mysql_string=`echo $CHILI_REQUIRED_ROLES | sed "s~\>~'~g ; s~\<~,'~g ; s~^,~~ ; s~ ~~g"`
|
roles_mysql_string=`echo $REDMINE_REQUIRED_ROLES | sed "s~\>~'~g ; s~\<~,'~g ; s~^,~~ ; s~ ~~g"`
|
||||||
ROLES=`mysql --default-character-set=utf8 -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT roles.name
|
ROLES=`mysql --default-character-set=utf8 -h$REDMINE_MYSQL_HOSTNAME -u $REDMINE_MYSQL_USER -e "SELECT roles.name
|
||||||
FROM $CHILI_MYSQL_DBNAME.roles,
|
FROM $REDMINE_MYSQL_DBNAME.roles,
|
||||||
$CHILI_MYSQL_DBNAME.member_roles,
|
$REDMINE_MYSQL_DBNAME.member_roles,
|
||||||
$CHILI_MYSQL_DBNAME.members
|
$REDMINE_MYSQL_DBNAME.members
|
||||||
WHERE roles.id=member_roles.role_id
|
WHERE roles.id=member_roles.role_id
|
||||||
AND member_roles.member_id=members.id
|
AND member_roles.member_id=members.id
|
||||||
AND members.user_id='$USERID'
|
AND members.user_id='$USERID'
|
||||||
|
@ -113,11 +113,11 @@ for i in `seq 0 $((nrepos-1))`; do
|
||||||
|
|
||||||
[ "$ROLES" == "" ] && continue
|
[ "$ROLES" == "" ] && continue
|
||||||
|
|
||||||
# === ATTACH RHODECODE REPOSITORY TO CHILIPROJECT ===
|
# === ATTACH RHODECODE REPOSITORY TO REDMINE ===
|
||||||
# DEBUG
|
# DEBUG
|
||||||
echo "insert $PROJECTID,${repos_paths[$i]},${repos_types[$i]}"
|
echo "insert $PROJECTID,${repos_paths[$i]},${repos_types[$i]}"
|
||||||
|
|
||||||
mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "INSERT INTO $CHILI_MYSQL_DBNAME.repositories(project_id,
|
mysql -h$REDMINE_MYSQL_HOSTNAME -u $REDMINE_MYSQL_USER -e "INSERT INTO $REDMINE_MYSQL_DBNAME.repositories(project_id,
|
||||||
url,
|
url,
|
||||||
root_url,
|
root_url,
|
||||||
type,
|
type,
|
Loading…
Reference in New Issue