点进去看下webhook的日志
我重新建了一个测试项目
然后直接在代码仓库复制仓库地址,打开git bash
执行
$ git clone http://gitlab.dongfang.cn/operation-dongfang/deploy-test.git
Cloning into 'deploy-test'...
warning: You appear to have cloned an empty repository.
49387@duhongx MINGW64 /f/dongfang
$ cd deploy-test/
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ ls
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ ls -al
total 8
drwxr-xr-x 1 49387 197609 0 5月 14 16:39 ./
drwxr-xr-x 1 49387 197609 0 5月 14 16:39 ../
drwxr-xr-x 1 49387 197609 0 5月 14 16:39 .git/
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ ls -al
total 8
drwxr-xr-x 1 49387 197609 0 5月 14 16:39 ./
drwxr-xr-x 1 49387 197609 0 5月 14 16:39 ../
drwxr-xr-x 1 49387 197609 0 5月 14 16:39 .git/
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ git add .
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ git commit -m "deploy test"
[master (root-commit) 55b3c39] deploy test
3 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 apache-maven-3.5.4-bin.tar.gz
create mode 100644 jdk-7u80-linux-x64.tar.gz
create mode 100644 nexus-2.14.8-01-bundle.tar.gz
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5/5), done.
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
Writing objects: 100% (5/5), 228.22 MiB | 24.45 MiB/s, done.
Total 5 (delta 0), reused 0 (delta 0)
fatal: the remote end hung up unexpectedly
Everything up-to-date
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ git init
Reinitialized existing Git repository in F:/dongfang/deploy-test/.git/
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ rm -rf .git/
49387@duhongx MINGW64 /f/dongfang/deploy-test
$ git init
Initialized empty Git repository in F:/dongfang/deploy-test/.git/
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ git remote add origin ssh://git@gitlab.dongfang.cn:2289/operation-dongfang/deploy-test.git
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ git add .
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ git commit -m "Initial commit"
[master (root-commit) fb671aa] Initial commit
3 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 apache-maven-3.5.4-bin.tar.gz
create mode 100644 jdk-7u80-linux-x64.tar.gz
create mode 100644 nexus-2.14.8-01-bundle.tar.gz
49387@duhongx MINGW64 /f/dongfang/deploy-test (master)
$ git push -u origin master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 228.22 MiB | 2.14 MiB/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To ssh://gitlab.dongfang.cn:2289/operation-dongfang/deploy-test.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
这样操作了之后gitlab上的webhook也是什么都没有,但是在gitlab的webhook手动test之后,然后在添加文件之后重新提交之后webhook的日志就有了,如下
但是页面上还是没有master分支
你那边方便远程吗 teamview?
有Teamviewer,我私信给你
现在是webhook不会自动触发 这边找下原因哈!
好的,gitlab的版本是11.4.7,是v0.15.0的版本。
[root@dongfang-his ~]# helm list --all | grep gitlab
gitlab 2 Tue May 14 04:09:53 2019 DEPLOYED gitlab-0.3.0 0.3.0 c7n-system
gitlab-client 1 Tue May 14 04:10:24 2019 DEPLOYED mysql-client-0.1.0 0.1.0 c7n-system
gitlab-mysql 1 Tue May 14 03:18:02 2019 DEPLOYED mysql-0.1.0 0.1.0 c7n-system
gitlab-mysql-pvc 1 Tue May 14 03:17:52 2019 DEPLOYED persistentvolumeclaim-0.1.0 v1 c7n-system
gitlab-pvc 1 Tue May 14 03:18:29 2019 DEPLOYED persistentvolumeclaim-0.1.0 v1 c7n-system
gitlab-redis 1 Tue May 14 03:18:20 2019 DEPLOYED redis-0.2.0 0.2.0 c7n-system
gitlab-redis-pvc 1 Tue May 14 03:18:12 2019 DEPLOYED persistentvolumeclaim-0.1.0 v1 c7n-system
gitlab-service 1 Tue May 14 05:26:43 2019 DEPLOYED gitlab-service-0.16.1 0.16.1 c7n-system
gitlab-user-identities 1 Tue May 14 04:11:28 2019 DEPLOYED mysql-client-0.1.0 0.1.0 c7n-system
runner 1 Tue May 14 04:09:01 2019 DEPLOYED gitlab-runner-0.2.0 alpine-v11.5.1 c7n-system
这个问题是因为迁移gitlab数据的时候,webhook的软连接迁移失败
去集群里面gitlab所在节点机器里面执行这个脚本
for entry in "."/*
do
echo "$entry"
if [[ ! -d $entry ]]; then
echo "$entry is not a directory"
continue
fi
cd $entry
for entry1 in "."/*
do
echo "$entry1"
if [[ ! -d $entry1 ]]; then
echo "$entry1 is not a directory"
continue
fi
pwd
cd $entry1
cp -av /var/opt/gitlab/git-data/repositories/new-group/new-project.git/hooks .
cd ..
done
cd ..
done
好的,谢谢!
建议后续官方网站上新增一个部署choerodon平台,并将之前gitlab数据完整迁移的文档。
如何正确的迁移gitlab建议你还是仔细阅读以下gitlab的官方文档之后再进行操作,我们暂不会在官网上重复这方面的内容。
root@gitlab-66c6ff5959-7l7xk:~# more repaire-webhook.sh
for entry in "."/*
do
echo "$entry"
if [[ ! -d $entry ]]; then
echo "$entry is not a directory"
continue
fi
cd $entry
for entry1 in "."/*
do
echo "$entry1"
if [[ ! -d $entry1 ]]; then
echo "$entry1 is not a directory"
continue
fi
pwd
cd $entry1
cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
cd ..
done
cd ..
done
root@gitlab-66c6ff5959-7l7xk:~# sh -x repaire-webhook.sh
+ echo ./hooks
./hooks
+ [[ ! -d ./hooks ]]
repaire-webhook.sh: 4: repaire-webhook.sh: [[: not found
+ cd ./hooks
+ echo ./hooks
./hooks
+ [[ ! -d ./hooks ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/root/hooks
+ cd ./hooks
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./post-receive
./post-receive
+ [[ ! -d ./post-receive ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/root/hooks
+ cd ./post-receive
repaire-webhook.sh: 17: cd: can't cd to ./post-receive
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./pre-receive
./pre-receive
+ [[ ! -d ./pre-receive ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/root
+ cd ./pre-receive
repaire-webhook.sh: 17: cd: can't cd to ./pre-receive
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./update
./update
+ [[ ! -d ./update ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./update
repaire-webhook.sh: 17: cd: can't cd to ./update
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ cd ..
+ echo ./repaire-webhook.sh
./repaire-webhook.sh
+ [[ ! -d ./repaire-webhook.sh ]]
repaire-webhook.sh: 4: repaire-webhook.sh: [[: not found
+ cd ./repaire-webhook.sh
repaire-webhook.sh: 8: cd: can't cd to ./repaire-webhook.sh
+ echo ./RELEASE
./RELEASE
+ [[ ! -d ./RELEASE ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./RELEASE
repaire-webhook.sh: 17: cd: can't cd to ./RELEASE
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./assets
./assets
+ [[ ! -d ./assets ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./assets
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./bin
./bin
+ [[ ! -d ./bin ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./bin
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./boot
./boot
+ [[ ! -d ./boot ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./boot
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./certs
./certs
+ [[ ! -d ./certs ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./certs
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./dev
./dev
+ [[ ! -d ./dev ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./dev
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./entrypoint.sh
./entrypoint.sh
+ [[ ! -d ./entrypoint.sh ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./entrypoint.sh
repaire-webhook.sh: 17: cd: can't cd to ./entrypoint.sh
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./etc
./etc
+ [[ ! -d ./etc ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./etc
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./home
./home
+ [[ ! -d ./home ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./home
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./hooks
./hooks
+ [[ ! -d ./hooks ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./hooks
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./lib
./lib
+ [[ ! -d ./lib ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./lib
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./lib64
./lib64
+ [[ ! -d ./lib64 ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./lib64
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./media
./media
+ [[ ! -d ./media ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./media
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./mnt
./mnt
+ [[ ! -d ./mnt ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./mnt
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./opt
./opt
+ [[ ! -d ./opt ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./opt
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./proc
./proc
+ [[ ! -d ./proc ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./proc
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
cp: cannot create symbolic link './hooks': No such file or directory
+ cd ..
+ echo ./root
./root
+ [[ ! -d ./root ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./root
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./run
./run
+ [[ ! -d ./run ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./run
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./sbin
./sbin
+ [[ ! -d ./sbin ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./sbin
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./srv
./srv
+ [[ ! -d ./srv ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./srv
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./sys
./sys
+ [[ ! -d ./sys ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./sys
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
cp: cannot create symbolic link './hooks': Read-only file system
+ cd ..
+ echo ./tmp
./tmp
+ [[ ! -d ./tmp ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./tmp
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./usr
./usr
+ [[ ! -d ./usr ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./usr
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ echo ./var
./var
+ [[ ! -d ./var ]]
repaire-webhook.sh: 12: repaire-webhook.sh: [[: not found
+ pwd
/
+ cd ./var
+ cp -av /var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks .
removed './hooks'
'/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks' -> './hooks'
+ cd ..
+ cd ..
需要去哪个目录手动操作步骤给我下吧,我去手动修复下这个问题。
把/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks
copy -av 到 pre-receive, upgrade, post-receive 目录下面试试看
请问你的问题解决了吗,我不是gitlab迁移的项目,都是新创建的也遇到了gitlab上master分支已经有了,在平台的–>分支里边创建不了分支,也找不到master分支,我看说要执行这个脚本,是在哪里执行的?是gitlab的容器里边吗?
把/var/opt/gitlab/git-data/repositories/operation-dongfang/client-main.git/hooks
copy -av 到 pre-receive, upgrade, post-receive 目录下面试试看
我在gitlib的容器中没有找到这三个目录,是需要自己创建吗,目录放到什么路径下呢?