samrocketman / gitlab-mirrors

A set of scripts adding the ability of managing remote mirrors to GitLab.
MIT License
818 stars 169 forks source link

should add --ignore=*.git #23

Closed FerencYAO closed 10 years ago

FerencYAO commented 10 years ago

ls -1 "${repo_dir}/${gitlab_namespace} should change to ls -1 --ignore=*.git "${repo_dir}/${gitlab_namespace}"

samrocketman commented 10 years ago

Just curious, when is there a *.git directory?

FerencYAO commented 10 years ago

after execute ./add_mirror.sh --git --project-name reachability --mirror https://github.com/tonymillion/Reachability.git

FerencYAO commented 10 years ago

in the gitlab_namespace directory generate the *.git file

samrocketman commented 10 years ago

That should create a directory in "${repo_dir}/${gitlab_namespace}" based on --project-name reachability. So there should only be ${repo_dir}/${gitlab_namespace}/reachability. Is this not the case with you?

FerencYAO commented 10 years ago

i think the *.git file is lib/manage_gitlab_project.py generate

FerencYAO commented 10 years ago

manage_gitlab_project.py create the project so the *.git file exist in the ${repo_dir}/${gitlab_namespace} directory.

samrocketman commented 10 years ago

manage_gitlab_project.py does not touch the local filesystem at all. It resolves the gitlab remote (or if the project doesn't exist it creates the project and returns the remote). Can you ls -a -1 ${repo_dir}/${gitlab_namespace}/? Show me what you see.

Also, you don't mention where the ls -1 is that you want to change. I assume you mean within ls-mirrors.sh. The folders created when you view ls -1 in ls-mirrors.sh are created by a git command. The folder created should be literally reachability in your case.

FerencYAO commented 10 years ago

i found the reason, i use the same user for gitlab-mirrors and gitlab, so reachability and reachability.git in the same directory. git@efserver:~/repositories/mirrors$ ls -al /home/git/repositories/mirrors/ total 96 drwxrwx--- 24 git git 4096 Feb 12 11:28 . drwxrws--- 7 git git 4096 Feb 12 09:32 .. drwxrwxr-x 7 git git 4096 Feb 12 11:28 egotableviewpullrefresh drwxrwx--- 7 git git 4096 Feb 12 11:28 egotableviewpullrefresh.git drwxrwxr-x 7 git git 4096 Feb 12 11:27 fmdb drwxrwx--- 7 git git 4096 Feb 12 11:26 fmdb.git drwxrwxr-x 7 git git 4096 Feb 12 11:25 jasidepanels drwxrwx--- 7 git git 4096 Feb 12 11:25 jasidepanels.git drwxrwxr-x 7 git git 4096 Feb 12 11:20 mknetworkkit drwxrwx--- 7 git git 4096 Feb 12 11:19 mknetworkkit.git drwxrwxr-x 7 git git 4096 Feb 12 11:22 openudid drwxrwx--- 7 git git 4096 Feb 12 11:22 openudid.git drwxrwxr-x 7 git git 4096 Feb 12 11:24 pscollectionview drwxrwx--- 7 git git 4096 Feb 12 11:24 pscollectionview.git drwxrwxr-x 7 git git 4096 Feb 12 11:10 reachability drwxrwx--- 7 git git 4096 Feb 12 11:10 reachability.git drwxrwxr-x 7 git git 4096 Feb 12 11:21 ssziparchive drwxrwx--- 7 git git 4096 Feb 12 11:21 ssziparchive.git drwxrwxr-x 7 git git 4096 Feb 12 11:22 svprogresshud drwxrwx--- 7 git git 4096 Feb 12 11:22 svprogresshud.git drwxrwxr-x 7 git git 4096 Feb 12 11:23 toast drwxrwx--- 7 git git 4096 Feb 12 11:23 toast.git drwxrwxr-x 7 git git 4096 Feb 12 11:26 tttattributedlabel drwxrwx--- 7 git git 4096 Feb 12 11:26 tttattributedlabel.git

config.sh:

The user git-mirrors will run as.

system_user="git"

The home directory path of the $system_user

user_home="/home/${system_user}"

The repository directory where gitlab-mirrors will contain copies of mirrored repositories before pushing them to gitlab.

repo_dir="${user_home}/repositories"

colorize output of add_mirror.sh, update_mirror.sh, and git-mirrors.sh commands.

enable_colors=true

These are additional options which should be passed to git-svn. See git help svn

git_svn_additional_options="-s"

Force gitlab-mirrors to not create the gitlab remote

no_create_set=false

#

Gitlab settings

#

This is the Gitlab group where all project mirrors will be grouped.

gitlab_namespace="mirrors"

This is the base web url of your Gitlab server.

gitlab_url="http://iosteam.gitlab.com"

Special user you created in Gitlab whose only purpose is to update mirror sites and admin the $gitlab_namespace group.

gitlab_user="gitmirror"

Generate a token for your $gitlab_user and set it here.

gitlab_user_token_secret="$(head -n1 "${user_home}/private_token")"

Verify signed SSL certificates?

ssl_verify=false

sorry for this, you awesome

samrocketman commented 10 years ago

Ah yes, You can't use the same user as gitlab... this is true. It is recommended to keep them separate. Perhaps it would help for me to change the default repositories directory so it doesn't coincide with GitLab's repositories directory.

I also have plans for an easy setup script #12 which will hopefully resolve issues like this.